|
@@ -27,7 +27,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="order-box">
|
|
|
- <view class="order-box-item" v-for="(item, index) in orderList" :key="index">
|
|
|
+ <view class="order-box-item" v-for="(item, index) in orderList" :key="index" @click="toOrder(item)">
|
|
|
<image :src="item.icon"></image>
|
|
|
<text class="name">{{ item.label }}</text>
|
|
|
</view>
|
|
@@ -41,19 +41,20 @@
|
|
|
</view>
|
|
|
<image class="more" :src="moreImg"></image>
|
|
|
</view>
|
|
|
- <view class="outline">退出登录</view>
|
|
|
+ <view class="outline" @click="outLogin()">退出登录</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import config from '@/config'
|
|
|
-import { loginWx } from '@/apis/user.js'
|
|
|
+import { loginWx,logout } from '@/apis/user.js'
|
|
|
export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- name: '',
|
|
|
+ name: uni.getStorageSync('name'),
|
|
|
+ token: uni.getStorageSync('token'),
|
|
|
code: '',
|
|
|
bgImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/bg_top%403x.png",
|
|
|
logoImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/img_logo%403x.png",
|
|
@@ -88,8 +89,11 @@ export default {
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
onLoad() {
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ let token = uni.getStorageSync('token')
|
|
|
+ if(!token){
|
|
|
+ this.toLogin()
|
|
|
+ }
|
|
|
// if(code !== null || code !== "") {
|
|
|
// this.getOpenidAndUserinfo(code)
|
|
|
// }
|
|
@@ -102,7 +106,8 @@ export default {
|
|
|
toLogin() {
|
|
|
let isWX = this.isWechat()
|
|
|
if (isWX) {
|
|
|
- let code = this.getUrlCode('code')
|
|
|
+ // let code = this.getUrlCode('code')
|
|
|
+ let code = '001t0H000xuK7U'
|
|
|
uni.showToast({
|
|
|
title: code,
|
|
|
})
|
|
@@ -183,9 +188,17 @@ export default {
|
|
|
backgroundColor: '#FFF'
|
|
|
})
|
|
|
},
|
|
|
- toOrder() {
|
|
|
+ toOrder(item) {
|
|
|
this.$router.push({
|
|
|
- path: '/pages/order/index'
|
|
|
+ path: '/pages/order/index?status=' + item.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ outLogin(){
|
|
|
+ logout().then(res => {
|
|
|
+ uni.removeStorageSync('accessToken')
|
|
|
+ uni.removeStorageSync('name')
|
|
|
+ this.name = ''
|
|
|
+ this.token = ''
|
|
|
})
|
|
|
}
|
|
|
},
|