diff --git a/App.vue b/App.vue
index 078d0b0..9ba8a00 100644
--- a/App.vue
+++ b/App.vue
@@ -3,6 +3,9 @@
onLaunch: function() {
this.$store.commit('initConfig')
this.$store.commit('getCategoryList')
+ if(uni.getStorageSync('token')){
+ this.$store.commit('getQrCode')
+ }
},
onShow: function() {
},
diff --git a/components/config/loginPopup.vue b/components/config/loginPopup.vue
new file mode 100644
index 0000000..ab40074
--- /dev/null
+++ b/components/config/loginPopup.vue
@@ -0,0 +1,123 @@
+
+
+
+ 登录后即可领取礼物
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/index/center.vue b/pages/index/center.vue
index ecbd910..27af34e 100644
--- a/pages/index/center.vue
+++ b/pages/index/center.vue
@@ -218,9 +218,9 @@
logout(){
uni.showModal({
title: '确认退出登录吗',
- success(r) {
+ success : (r) => {
if (r.confirm) {
- this.$store.commit('logout')
+ this.$store.commit('logout', true)
}
}
})
diff --git a/pages_order/mine/promotion.vue b/pages_order/mine/promotion.vue
index 065afaa..46aeb04 100644
--- a/pages_order/mine/promotion.vue
+++ b/pages_order/mine/promotion.vue
@@ -9,7 +9,7 @@
+ :src="promotionUrl" mode="aspectFill">
@@ -42,24 +42,31 @@ import index from '../../uni_modules/uv-ui-tools'
},
onShow() {
let that = this;
- if(that.promotionUrl){
- that.imagePath = that.promotionUrl
- console.log("当前地址:"+that.imagePath)
- }else{
- that.getQrCode()
+ if(!that.promotionUrl){
+ // that.getQrCode()
+ uni.showLoading({
+ title: "拼命绘画中..."
+ })
}
that.$store.commit('getUserInfo')
},
methods: {
getQrCode() {
+ uni.showLoading({
+ title: "拼命绘画中..."
+ })
let that = this;
that.$api('getInviteCode', res => {
if (res.code == 200) {
- console.log("----------")
- console.log(res)
that.url = res.result.url
that.title = res.result.name
- that.draw()
+
+ that.imagePath = that.$config.aliOss.url + res.result.url
+
+ that.$store.commit('setPromotionUrl', that.imagePath)
+
+ // that.draw()
+ uni.hideLoading()
}
})
},
diff --git a/pages_order/order/instantGift.vue b/pages_order/order/instantGift.vue
index 823d9e0..cf39ef6 100644
--- a/pages_order/order/instantGift.vue
+++ b/pages_order/order/instantGift.vue
@@ -70,42 +70,30 @@
}
},
onShareAppMessage(res) {
- let o = {
- title : this.blessing || this.giveTitle,
- path : '/pages_order/order/receiveGift?id=' + this.id,
- imageUrl : this.giftList[this.selectedIndex].image,
- }
- if(this.userInfo.id){
- o.path += '&shareId=' + this.userInfo.id
- }
- return o
+ return this.getShareData(res)
},
//2.分享到朋友圈
onShareTimeline(res) {
- let o = {
- title : this.blessing || this.giveTitle,
- path : '/pages_order/order/receiveGift?id=' + this.id,
- imageUrl : this.giftList[this.selectedIndex].image,
- }
- if(this.userInfo.id){
- o.path += '&shareId=' + this.userInfo.id
- }
- return o
+ return this.getShareData(res)
},
methods: {
+ getShareData(res){
+ let o = {
+ title : `${this.configList.logo_name}用户${this.userInfo.nickName}挑选了1份礼物送给你,请收下这份心意`,
+ path : '/pages_order/order/receiveGift?id=' + this.id,
+ imageUrl : this.giftList[this.selectedIndex].image,
+ }
+ if(this.userInfo.id){
+ o.path += '&shareId=' + this.userInfo.id
+ }
+ return o
+ },
navigateBack() {
uni.navigateBack()
},
selectGift(index) {
this.selectedIndex = index
},
- sendGift() {
- // 实现送礼逻辑
- uni.showToast({
- title: '送礼成功',
- icon: 'success'
- })
- },
// 获取祝福背景图
getRiceBlessing(){
this.$api('getRiceBlessing')
diff --git a/pages_order/order/receiveGift.vue b/pages_order/order/receiveGift.vue
index 47b189a..e8d9807 100644
--- a/pages_order/order/receiveGift.vue
+++ b/pages_order/order/receiveGift.vue
@@ -158,16 +158,20 @@
+
+