From 4f30734588eb34ea2d7c27856f72ce40da8ab365 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期六, 28 二月 2026 12:01:10 +0800
Subject: [PATCH] 小程序 接口开发
---
mini-program/pages/mine/mine.vue | 63 +++++++++++++++++++++++--------
1 files changed, 47 insertions(+), 16 deletions(-)
diff --git a/mini-program/pages/mine/mine.vue b/mini-program/pages/mine/mine.vue
index 31b5325..e425685 100644
--- a/mini-program/pages/mine/mine.vue
+++ b/mini-program/pages/mine/mine.vue
@@ -8,7 +8,7 @@
<view class="user">
<view class="user-left">
<view class="user-image">
- <image :src="userInfo.imgFullUrl" mode="widthFix"></image>
+ <image :src="userInfo.imgFullUrl?userInfo.imgFullUrl:'/static/icon/default.png'" mode="widthFix"></image>
</view>
<view class="user-name">
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" v-if="!userInfo">鑾峰彇鎵嬫満鍙�</button>
@@ -20,7 +20,7 @@
<image src="/static/icon/ic_option@2x.png" mode="widthFix"></image>
</view>
<view class="user-right-item" @click="jumpNotice">
- <view class="user-right-item-tips" v-if="objNum && objNum.unRead === 1"></view>
+ <view class="user-right-item-tips" v-if="objNum && objNum.unRead === 0"></view>
<image src="/static/icon/ic_notice@2x.png" mode="widthFix"></image>
</view>
</view>
@@ -69,8 +69,8 @@
</view>
</view>
</view>
- <view class="guanggao">
- <image src="/static/images/share@2x.png" mode="widthFix"></image>
+ <view class="guanggao" @click="jumpShare()">
+ <image :src="share" mode="widthFix"></image>
</view>
<view class="gn">
<view class="gn-item" @click="jump()">
@@ -78,6 +78,7 @@
<image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
</view>
<view class="gn-item">
+ <button open-type="contact">瀹㈡湇</button>
<text>鍦ㄧ嚎瀹㈡湇</text>
<image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
</view>
@@ -94,18 +95,27 @@
import { mapState } from 'vuex'
export default {
computed: {
- ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo'])
+ ...mapState(['navHeight', 'statusbarHeight', 'openid', 'userInfo','recshopid','recuserid'])
},
data() {
return {
objNum: null,
- orderNum: null
+ orderNum: null,
+ share: ''
};
},
async onLoad() {
await this.$onLaunched;
- this.getMyInfo()
+ if (uni.getStorageSync('backgroundImage')) {
+ this.share = uni.getStorageSync('backgroundImage').centerInviteBg
+ }
this.ordersStatistics()
+ },
+ async onShow() {
+ await this.$onLaunched;
+ if (this.userInfo) {
+ this.getMyInfo()
+ }
},
methods: {
jumpTo(type) {
@@ -132,6 +142,11 @@
url: '/pages/login/login'
})
},
+ jumpShare(){
+ uni.navigateTo({
+ url: '/pages/share/share'
+ })
+ },
// 璺宠浆娑堟伅
jumpNotice() {
uni.navigateTo({
@@ -146,15 +161,21 @@
},
// 鎺堟潈鎵嬫満鍙�
getphonenumber(e) {
- this.$u.api.wxPhone({
- code: e.detail.code,
- openid: this.openid
- }).then(res => {
- if (res.code === 200) {
- this.$store.commit('setUserInfo', res.data.member)
- this.$store.commit('setToken', res.data.token)
- }
- })
+ if (e.detail.errMsg === 'getPhoneNumber:ok') {
+ this.$u.api.wxPhone({
+ code: e.detail.code,
+ shopId:this.recshopid,
+ recId:this.recuserid,
+ openid: this.openid
+ }).then(res => {
+ if (res.code === 200) {
+ this.$store.commit('setUserInfo', res.data.member)
+ this.$store.commit('setToken', res.data.token)
+ this.$store.commit('setRecShopId','')
+ this.$store.commit('setRecUserId','')
+ }
+ })
+ }
},
// 鑾峰彇鏀惰棌绛夋暟閲�
getMyInfo() {
@@ -233,9 +254,19 @@
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #E5E5E5;
+ position: relative;
&:last-child {
border: none !important;
}
+ button {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ z-index: 99;
+ }
text {
font-weight: 400;
font-size: 30rpx;
--
Gitblit v1.9.3