Commit d77ac75e authored by zhangjianguo's avatar zhangjianguo

1

parent bcad63e4
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
@confirm="confirm" @confirm="confirm"
></u-modal> ></u-modal>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
</view> </view>
</template> </template>
...@@ -116,18 +116,20 @@ export default { ...@@ -116,18 +116,20 @@ export default {
}); });
}, },
onLoad(option) { onLoad(option) {
this.u = wx.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) { if (!this.u) {
this.u = { this.u = {
nickName: "未登录", nickName: "未登录",
avatarUrl: "" avatarUrl: ""
}; };
this.showAuth = true; this.showAuth = true;
} } else{
this.init();
}
if (option && option.form) { if (option && option.form) {
(this.source = option.form), (this.defaultId = option.id); (this.source = option.form), (this.defaultId = option.id);
} }
this.init();
}, },
methods: { methods: {
chosenHandler(item){ chosenHandler(item){
...@@ -163,7 +165,11 @@ export default { ...@@ -163,7 +165,11 @@ export default {
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth = false; this.showAuth = false;
this.init();
}, },
goback(){
uni.navigateBack()
},
isdefault(item) { isdefault(item) {
//设置默认地址 //设置默认地址
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
......
...@@ -78,20 +78,20 @@ ...@@ -78,20 +78,20 @@
</view> </view>
<!-- 取消提示 --> <!-- 取消提示 -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
</view> </view>
</template> </template>
<script> <script>
import auth from "../../../components/auth/index.vue";
export default { export default {
components: { components: {
auth
}, },
data() { data() {
return { return {
pageTitle: "我的优惠券", pageTitle: "我的优惠券",
showAuth:false,
list: [ list: [
{ name: "未使用" }, { name: "未使用" },
{ name: "已使用" }, { name: "已使用" },
...@@ -136,8 +136,16 @@ export default { ...@@ -136,8 +136,16 @@ export default {
}); });
}, },
onLoad: function (option) { onLoad: function (option) {
this.loading = true; this.u = uni.getStorageSync("mall_UserInfo");
this.init(); if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.init();
}
}, },
methods: { methods: {
change(index) { change(index) {
...@@ -180,6 +188,14 @@ export default { ...@@ -180,6 +188,14 @@ export default {
this.status = "nomore"; this.status = "nomore";
} }
}, },
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth=false;
this.init();
},
goback(){
uni.navigateBack()
},
godetails(item){ godetails(item){
if(this.msg.UseState ==0){ if(this.msg.UseState ==0){
uni.navigateTo({ uni.navigateTo({
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</view> </view>
</template> </template>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku> <good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
<!-- <auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> --> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
</view> </view>
</template> </template>
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
created(){ created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px'; this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.init()
}, },
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
...@@ -135,7 +135,11 @@ ...@@ -135,7 +135,11 @@
avatarUrl: "" avatarUrl: ""
}; };
this.showAuth = true; this.showAuth = true;
} } else{
this.init();
}
}, },
methods: { methods: {
...@@ -192,7 +196,11 @@ ...@@ -192,7 +196,11 @@
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth=false this.showAuth=false;
this.init();
},
goback(){
uni.navigateBack()
}, },
clickHandler(cx) { clickHandler(cx) {
uni.navigateTo({ uni.navigateTo({
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</scroll-view> </scroll-view>
</view> </view>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo"></auth> <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
<view class="loading" v-show="loading"> <view class="loading" v-show="loading">
<u-loading mode="flower" size="48"></u-loading> <u-loading mode="flower" size="48"></u-loading>
<Text style='color: #fff;margin-top: 10rpx;'>加载中...</Text> <Text style='color: #fff;margin-top: 10rpx;'>加载中...</Text>
...@@ -136,9 +136,7 @@ ...@@ -136,9 +136,7 @@
data() { data() {
return { return {
pageTitle:"我的足迹", pageTitle:"我的足迹",
isloading:true,
loading:false, loading:false,
loading2:false,
showAuth:false, showAuth:false,
contentHeight:0, contentHeight:0,
mainColor: "", mainColor: "",
...@@ -184,7 +182,7 @@ ...@@ -184,7 +182,7 @@
created(){ created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px'; this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.fun_date(0)
}, },
mounted() { mounted() {
...@@ -210,7 +208,9 @@ ...@@ -210,7 +208,9 @@
avatarUrl: "" avatarUrl: ""
}; };
this.showAuth = true; this.showAuth = true;
} } else{
this.fun_date(0)
}
}, },
methods: { methods: {
init(){ init(){
...@@ -250,8 +250,13 @@ ...@@ -250,8 +250,13 @@
} }
}, },
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth=false this.showAuth=false;
this.init(); //成功之后调取接口
},
goback(){
uni.navigateBack()
}, },
change(index) { change(index) {
this.current = index; this.current = index;
......
...@@ -52,15 +52,16 @@ ...@@ -52,15 +52,16 @@
<!-- 取消提示 --> <!-- 取消提示 -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'goback'></auth>
</view> </view>
</template> </template>
<script> <script>
import auth from "../../../components/auth/index.vue";
export default { export default {
components: { components: {
auth
}, },
data() { data() {
return { return {
...@@ -71,7 +72,7 @@ export default { ...@@ -71,7 +72,7 @@ export default {
{ name: "支出" }, { name: "支出" },
], ],
showAuth:false,
msg:{ msg:{
pageIndex: 1, pageIndex: 1,
pageSize:10, pageSize:10,
...@@ -112,10 +113,20 @@ export default { ...@@ -112,10 +113,20 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.pageTitle, title: this.pageTitle,
}); });
this.loading = true;
this.init();
}, },
onLoad(){
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.init();
}
},
methods: { methods: {
change(index) { change(index) {
...@@ -127,7 +138,7 @@ export default { ...@@ -127,7 +138,7 @@ export default {
this.init(); this.init();
}, },
init() { init() {
this.loading = true;
this.msg.Type = this.current+1 this.msg.Type = this.current+1
this.request2( this.request2(
{ {
...@@ -157,6 +168,14 @@ export default { ...@@ -157,6 +168,14 @@ export default {
this.status = "nomore"; this.status = "nomore";
} }
}, },
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.showAuth=false;
this.init();
},
goback(){
uni.navigateBack()
},
}, },
}; };
</script> </script>
......
...@@ -130,13 +130,13 @@ export default { ...@@ -130,13 +130,13 @@ export default {
onLoad() { onLoad() {
this.navHeight = this.$navHeight - 2; this.navHeight = this.$navHeight - 2;
this.u = wx.getStorageSync('basedata').user_info; this.u = wx.getStorageSync('basedata').user_info;
if (!this.u) { // if (!this.u) {
this.u = { // this.u = {
nickname: '未登录', // nickname: '未登录',
avatarUrl: '' // avatarUrl: ''
}; // };
this.showAuth = true; // this.showAuth = true;
} // }
}, },
mounted() { mounted() {
let currentPages = getCurrentPages(); let currentPages = getCurrentPages();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment