|
|
@@ -80,8 +80,9 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import wexinPay from "@/utils/pay/wxPay";
|
|
|
+import wexinPay from "@/utils/pay/wxPay"
|
|
|
import { renewShop,needRemind } from "@/api/renew"
|
|
|
+import { postWxCode } from '@/api/mini'
|
|
|
export default {
|
|
|
name: "renew",
|
|
|
data(){
|
|
|
@@ -130,10 +131,20 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.renewType = type
|
|
|
- renewShop({price:price,type:type,remark:this.remark}).then(res=>{
|
|
|
- uni.hideLoading()
|
|
|
- if(res.code == 1){
|
|
|
- wexinPay(res.data, this.getSuccess, this.getError)
|
|
|
+ uni.login({
|
|
|
+ provider: 'weixin',
|
|
|
+ success: res => {
|
|
|
+ postWxCode({ code: res.code }).then(subRes => {
|
|
|
+ if(subRes.data.currentMiniOpenId){
|
|
|
+ let currentMiniOpenId = subRes.data.currentMiniOpenId
|
|
|
+ renewShop({price:price,type:type,remark:this.remark,currentMiniOpenId:currentMiniOpenId}).then(res=>{
|
|
|
+ uni.hideLoading()
|
|
|
+ if(res.code == 1){
|
|
|
+ wexinPay(res.data, this.getSuccess, this.getError)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
// #endif
|