hui.zhou
parent
77b80fe18b
commit
6f2734d8f9
|
|
@ -15,7 +15,7 @@ export default {
|
||||||
this.$store.dispatch('app/getArticle');
|
this.$store.dispatch('app/getArticle');
|
||||||
|
|
||||||
/* #ifdef MP-WEIXIN */
|
/* #ifdef MP-WEIXIN */
|
||||||
// wxMnpLogin()
|
// wxMnpLogin()
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
|
|
@ -29,11 +29,13 @@ export default {
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
onShow(option) {
|
onShow(option) {
|
||||||
console.log(option);
|
|
||||||
let invite_code = option.query.invite_code || strToParams(decodeURIComponent(option.query.scene)).invite_code
|
let invite_code = option.query.invite_code || strToParams(decodeURIComponent(option.query.scene)).invite_code
|
||||||
uni.setStorageSync('INVITE_CODE',invite_code)
|
uni.setStorageSync('INVITE_CODE',invite_code)
|
||||||
/* #ifdef MP-WEIXIN */
|
/* #ifdef MP-WEIXIN */
|
||||||
wxMnpLogin()
|
if(!invite_code){
|
||||||
|
wxMnpLogin()
|
||||||
|
}
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
</view>
|
</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u-form>
|
</u-form>
|
||||||
|
|
||||||
<view class="flex justify-between mt-45rpx">
|
<view class="flex justify-between mt-45rpx">
|
||||||
<text class="text-md" @tap="$u.route('/pageA/reset_password/login', { type: 0 })">忘记密码?</text>
|
<text class="text-md" @tap="$u.route('/pageA/reset_password/login', { type: 0 })">忘记密码?</text>
|
||||||
<text class="text-md text-primary" @tap="$u.route('/pages/register/index')">注册</text>
|
<text class="text-md text-primary" @tap="$u.route('/pages/register/index')">注册</text>
|
||||||
|
|
@ -98,8 +98,8 @@ export default {
|
||||||
// this.$refs.uForm.setRules(this.rules);
|
// this.$refs.uForm.setRules(this.rules);
|
||||||
},
|
},
|
||||||
async onLoad({ type, phone,redirec}) {
|
async onLoad({ type, phone,redirec}) {
|
||||||
|
|
||||||
|
|
||||||
this.redirec = redirec
|
this.redirec = redirec
|
||||||
this.form.phone = phone ?? '';
|
this.form.phone = phone ?? '';
|
||||||
/* #ifdef MP-WEIXIN */
|
/* #ifdef MP-WEIXIN */
|
||||||
|
|
|
||||||
|
|
@ -8,37 +8,23 @@
|
||||||
import {
|
import {
|
||||||
strToParams
|
strToParams
|
||||||
} from '@/utils/tools';
|
} from '@/utils/tools';
|
||||||
|
import { wxMnpLogin } from '@/utils/login'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
scene:null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
const scene = strToParams(decodeURIComponent(e.scene))
|
const scene = strToParams(decodeURIComponent(e.scene))
|
||||||
console.log(scene);
|
this.scene=scene
|
||||||
|
uni.setStorageSync('INVITE_CODE', scene.invite_code)
|
||||||
if (scene.product) {
|
if (scene.product) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/product_details/index?skuId=' + scene.product
|
url: '/pages/product_details/index?skuId=' + scene.product
|
||||||
})
|
})
|
||||||
uni.setStorageSync('INVITE_CODE', scene.code)
|
uni.setStorageSync('INVITE_CODE', scene.code)
|
||||||
} else if (scene.order_pre) {
|
} else if (scene.order_pre) {
|
||||||
setTimeout(async () => {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
const obj = {
|
|
||||||
id: scene.order_pre
|
|
||||||
}
|
|
||||||
const {
|
|
||||||
order_id
|
|
||||||
} = await this.$api.post(`/v1/order-pre/order`, obj)
|
|
||||||
uni.hideLoading()
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/order_details/index?id=' + order_id
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
}else if(scene.invite_code){
|
}else if(scene.invite_code){
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
|
|
@ -46,6 +32,33 @@
|
||||||
uni.setStorageSync('INVITE_CODE', scene.invite_code)
|
uni.setStorageSync('INVITE_CODE', scene.invite_code)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
if(this.scene.order_pre){
|
||||||
|
this.getOrder(this.scene.order_pre)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
//生成订单
|
||||||
|
async getOrder(id){
|
||||||
|
try{
|
||||||
|
const obj = {
|
||||||
|
id:id
|
||||||
|
}
|
||||||
|
const {order_id}=await this.$api.post(`/v1/order-pre/order`,obj,{
|
||||||
|
custom:{
|
||||||
|
silence:true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
uni.redirectTo({
|
||||||
|
url: '/pages/order_details/index?id=' + order_id
|
||||||
|
})
|
||||||
|
}catch(err){
|
||||||
|
if(err.errcode==401){
|
||||||
|
uni.navigateTo({ url: '/pages/login/index' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue