From a6cdbcfe28fcc40ebb4919f57d60fb20122e8e57 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期二, 12 八月 2025 09:10:35 +0800 Subject: [PATCH] 1 --- pages/mine/index.vue | 1448 +++++++++++++++++++++++++-------------------------------- 1 files changed, 631 insertions(+), 817 deletions(-) diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 1ed273b..6ff401e 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -1,842 +1,656 @@ <template> - <view class="page" > - <image class="bg-image" src="/static/images/index/bg.png" mode="scaleToFill"></image> - <view class="container"> - <!-- 鐢ㄦ埛淇℃伅鍖哄煙 --> - <view class="user-info"> - <view class="user-info__left"> - <view v-if="!avatar"> - <image class="avatar" src="/static/images/index/tx.png" mode="scaleToFill"></image> - </view> - <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="avatar" - mode="widthFix"> - </image> - <!-- <image class="avatar" - :src="avatar" /> --> - <view v-if="!name" @click="handleToLogin" class="user-info"> - <view class="u_title"> - 鐧诲綍 - </view> - </view> - <!-- <view v-else @click="handleToInfo" class="user-info"> - <view class="u_title"> - 鐢ㄦ埛:{{name}} - </view> - </view> --> - <view class="user-info__content" v-else @click="handleToInfo"> - <view class="name-wrapper"> - <text class="name">{{name}}</text> - <view class="certified">宸茶璇�</view> - </view> - <text class="phone">18408545566</text> - </view> - </view> - <view class="user-info__right" @click="handleToInfo"> - <text class="personal-info">涓汉淇℃伅</text> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> + <view class="page"> + <image class="bg-image" src="/static/images/index/bg.png" mode="scaleToFill"></image> + <view class="container"> + <!-- 鐢ㄦ埛淇℃伅鍖哄煙 --> + <view class="user-info"> + <view class="user-info__left"> + <view v-if="!avatar"> + <image class="avatar" src="/static/images/index/tx.png" mode="scaleToFill"></image> + </view> + <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="avatar" mode="widthFix"></image> + <view v-if="!name" @click="handleToLogin" class="user-info"> + <view class="u_title">鐧诲綍</view> + </view> + <view class="user-info__content" v-else @click="handleToInfo"> + <view class="name-wrapper"> + <text class="name">{{name}}</text> + <view class="certified">宸茶璇�</view> + </view> + <text class="phone">{{phone || '鏈粦瀹氭墜鏈哄彿'}}</text> + </view> + </view> + <view class="user-info__right" @click="handleToInfo"> + <text class="personal-info">涓汉淇℃伅</text> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> - <!-- 蹇嵎鍔熻兘鍖� --> - <view class="quick-functions"> - <view class="function-item" @click="history('/pagesA/Examiner/Examiner')"> - <view class="icon-img"> - <!-- <uni-icons type="calendar" size="28" color="#3AA0FF" /> --> - <image class="icon-img" src="/static/images/index/灏辫瘖璁板綍.png" mode="scaleToFill"></image> - </view> - <text class="function-text">闂瘖璁板綍</text> - </view> - <view class="function-item" @click="questionnaire"> - <!-- <view class="function-icon"> - <uni-icons type="star" size="28" color="#FFB442" /> - </view> --> - <view class="icon-img"> - <!-- <uni-icons type="calendar" size="28" color="#3AA0FF" /> --> - <image class="icon-img" src="/static/images/index/婊℃剰搴�.png" mode="scaleToFill"></image> - </view> - <text class="function-text">闂嵎璋冩煡</text> - </view> - <view class="function-item" @click="handleBuilding"> - <view class="icon-img"> - <image class="icon-img" src="/static/images/index/妫�鏌ヨ褰�.png" mode="scaleToFill"></image> - <!-- <uni-icons type="search" size="28" color="#3AA0FF" /> --> - </view> - <text class="function-text">鎴戠殑浣撴</text> - </view> - </view> + <!-- 蹇嵎鍔熻兘鍖� --> + <view class="quick-functions"> + <view class="function-item" @click="history('/pagesA/Examiner/Examiner')"> + <view class="icon-img"> + <image class="icon-img" src="/static/images/index/灏辫瘖璁板綍.png" mode="scaleToFill"></image> + </view> + <text class="function-text">闂瘖璁板綍</text> + </view> + <view class="function-item" @click="questionnaire"> + <view class="icon-img"> + <image class="icon-img" src="/static/images/index/婊℃剰搴�.png" mode="scaleToFill"></image> + </view> + <text class="function-text">闂嵎璋冩煡</text> + </view> + <view class="function-item" @click="handleBuilding"> + <view class="icon-img"> + <image class="icon-img" src="/static/images/index/妫�鏌ヨ褰�.png" mode="scaleToFill"></image> + </view> + <text class="function-text">鎴戠殑浣撴</text> + </view> + </view> - <!-- 甯哥敤宸ュ叿鍖� --> - <view class="tools-section"> - <view class="tools-title">甯哥敤宸ュ叿</view> - <view class="tools-list"> - <view class="tool-item"> - <view class="tool-item__left"> - <!-- <uni-icons type="phone" size="20" color="#666" /> --> - <image class="rt-image" src="/static/images/tabbar/phone.png" mode="scaleToFill"></image> - <text class="tool-text">鎵嬫満鍙风爜</text> - </view> - <view class="tool-item__right" @click="getcusPhone"> - <text class="status confirmed">纭</text> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> + <!-- 甯哥敤宸ュ叿鍖� --> + <view class="tools-section"> + <view class="tools-title">甯哥敤宸ュ叿</view> + <view class="tools-list"> + <view class="tool-item"> + <view class="tool-item__left"> + <image class="rt-image" src="/static/images/tabbar/phone.png" mode="scaleToFill"></image> + <text class="tool-text">鎵嬫満鍙风爜</text> + </view> + <view class="tool-item__right" @click="getcusPhone"> + <text class="status confirmed">纭</text> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> + <view class="tool-item"> + <view class="tool-item__left"> + <image class="rt-image" src="/static/images/index/xx.png" mode="scaleToFill"></image> + <text class="tool-text">鎺ュ彈娑堟伅閫氱煡</text> + </view> + <view class="tool-item__right" @tap="subScriptionMessage"> + <text class="status allowed">鍏佽</text> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> + <view class="tool-item" @click="personnel('/pagesA/Examiner/Examiner')"> + <view class="tool-item__left"> + <image class="rt-image" src="/static/images/index/ry.png" mode="scaleToFill"></image> + <text class="tool-text">浣撴浜哄憳</text> + </view> + <view class="tool-item__right"> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> + <view class="tool-item" @click="handleToPwd"> + <view class="tool-item__left"> + <image class="rt-image" src="/static/images/index/mm.png" mode="scaleToFill"></image> + <text class="tool-text">淇敼瀵嗙爜</text> + </view> + <view class="tool-item__right"> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> + <view class="tool-item" @click="handleAbout"> + <view class="tool-item__left"> + <image class="rt-image" src="/static/images/index/all.png" mode="scaleToFill"></image> + <text class="tool-text">鍏充簬鎴戜滑</text> + </view> + <view class="tool-item__right"> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> + <view class="tool-item" @click="handleHelp"> + <view class="tool-item__left"> + <image class="rt-image" src="/static/images/index/wt.png" mode="scaleToFill"></image> + <text class="tool-text">甯歌闂</text> + </view> + <view class="tool-item__right"> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> + <view class="tool-item"> + <view class="tool-item__left" @click="handleLogout"> + <image class="rt-image" src="/static/images/tabbar/cart.png" mode="scaleToFill"></image> + <text class="tool-text">閫�鍑虹櫥褰�</text> + </view> + <view class="tool-item__right"> + <uni-icons type="right" size="16" color="#999" /> + </view> + </view> + </view> + </view> - <view class="tool-item"> - <view class="tool-item__left"> - <!-- <uni-icons type="notification" size="20" color="#666" /> --> - <image class="rt-image" src="/static/images/index/xx.png" mode="scaleToFill"></image> - <text class="tool-text">鎺ュ彈娑堟伅閫氱煡</text> - </view> - <view class="tool-item__right" @tap="subScriptionMessage"> - <text class="status allowed">鍏佽</text> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> + <!-- 鎶�鏈敮鎸佷俊鎭� --> + <view class="tech-support"> + <text>@鎶�鏈敮鎸侊細璺嘲绉戞妧鏈夐檺鍏徃</text> + </view> - <view class="tool-item" @click="personnel('/pagesA/Examiner/Examiner')"> - <view class="tool-item__left"> - <!-- <uni-icons type="staff" size="20" color="#666" /> --> - <image class="rt-image" src="/static/images/index/ry.png" mode="scaleToFill"></image> - <text class="tool-text">浣撴浜哄憳</text> - </view> - <view class="tool-item__right"> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> - - <view class="tool-item" @click="handleToPwd"> - <view class="tool-item__left"> - <!-- <uni-icons type="locked" size="20" color="#666" /> --> - <image class="rt-image" src="/static/images/index/mm.png" mode="scaleToFill"></image> - <text class="tool-text">淇敼瀵嗙爜</text> - </view> - <view class="tool-item__right"> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> - - <view class="tool-item" @click="handleAbout"> - <view class="tool-item__left"> - <image class="rt-image" src="/static/images/index/all.png" mode="scaleToFill"></image> - <!-- <uni-icons type="info" size="20" color="#666" /> --> - <text class="tool-text">鍏充簬鎴戜滑</text> - </view> - <view class="tool-item__right"> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> - - <view class="tool-item" @click="handleHelp"> - <view class="tool-item__left"> - <!-- <uni-icons type="help" size="20" color="#666" /> --> - <image class="rt-image" src="/static/images/index/wt.png" mode="scaleToFill"></image> - <text class="tool-text">甯歌闂</text> - </view> - <view class="tool-item__right"> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> - - <view class="tool-item"> - <view class="tool-item__left" @click="handleLogout"> - <!-- <uni-icons type="logout" size="20" color="#666" /> --> - <image class="rt-image" src="/static/images/tabbar/cart.png" mode="scaleToFill"></image> - <text class="tool-text">閫�鍑虹櫥褰�</text> - </view> - <view class="tool-item__right"> - <uni-icons type="right" size="16" color="#999" /> - </view> - </view> - </view> - </view> - - <!-- 鎶�鏈敮鎸佷俊鎭� --> - <view class="tech-support"> - <text>@鎶�鏈敮鎸侊細璺嘲绉戞妧鏈夐檺鍏徃</text> - </view> - </view> - <!--椤堕儴涓汉淇℃伅鏍�--> - <!-- <view class="header-section"> - <view class="flex padding justify-between"> - <view class="flex align-center"> - - <view v-if="!avatar" class="cu-avatar xl round bg-white"> - <view class="iconfont icon-people text-gray icon"></view> - </view> - <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" - mode="widthFix"> - </image> - <view v-if="!name" @click="handleToLogin" class="user-info"> - <view class="u_title"> - 鐧诲綍 - </view> - </view> - <view v-else @click="handleToInfo" class="user-info"> - <view class="u_title"> - 鐢ㄦ埛:{{name}} - </view> - </view> - - </view> - <view @click="handleToInfo" class="flex align-center"> - <text>涓汉淇℃伅</text> - <view class="iconfont icon-right"></view> - </view> - </view> - </view> - - <view class="content-section"> - <view class="mine-actions grid col-4 text-center"> - <view class="action-item" @click="handleJiaoLiuQun" v-if="disapley == 'flase'"> - <view class="iconfont icon-friendfill text-pink icon"></view> - <text class="text">鎴戠殑棰勭害</text> - </view> - <view class="action-item" @click="handleJiaoLiuQun" v-if="disapley == 'true'"> - <view class="iconfont icon-friendfill text-pink icon"></view> - <text class="text">鎴戠殑璁㈠崟</text> - </view> - <view class="action-item" @click="history('/pagesA/Examiner/Examiner?id=1')"> - <view class="iconfont icon-service text-blue icon"></view> - <text class="text">闂瘖璁板綍</text> - </view> - <view class="action-item" @click="questionnaire"> - <view class="iconfont icon-community text-mauve icon"></view> - <text class="text">闂嵎璋冩煡</text> - </view> - <view class="action-item" @click="handleBuilding"> - <view class="iconfont icon-dianzan text-green icon"></view> - <text class="text">鎴戠殑浣撴</text> - </view> - </view> - - <view class="menu-list"> - <view class="list-cell list-cell-arrow"> - <view class="menu-item-box"> - <view class="iconfont icon-refresh menu-icon"></view> - <input class="input" v-model="cusPhone" placeholder="鎵嬫満鍙风爜" /> - <button style="background-color:#ff834c;color: #fff;width: 24%;" size="mini" - @click="getcusPhone">纭</button> - </view> - </view> - <view class="list-cell list-cell-arrow"> - <view class="menu-item-box"> - <view class="iconfont icon-refresh menu-icon"></view> - <text>鎺ュ彈閫氱煡娑堟伅 </text> - <button :disabled="disabled" - style="width: 24%;margin-left:101px ;background-color:#ff834c;color: #fff;" size="mini" - type="primary" @tap="subScriptionMessage">鍏佽</button> - </view> - </view> - <view class="list-cell list-cell-arrow" @click="handleHelp"> - <view class="menu-item-box"> - <view class="iconfont icon-help menu-icon"></view> - <view>甯歌闂</view> - </view> - </view> - <view class="list-cell list-cell-arrow" @click="handleAbout"> - <view class="menu-item-box"> - <view class="iconfont icon-aixin menu-icon"></view> - <view>鍏充簬鎴戜滑</view> - </view> - </view> - <view class="list-cell list-cell-arrow" @click="personnel('/pagesA/Examiner/Examiner')"> - <view class="menu-item-box"> - <view class="iconfont icon-password menu-icon"></view> - <view>浣撴浜哄憳</view> - </view> - </view> - <!-- 灏唖etting/index鎸繃鏉�--> - <!--<view class="list-cell list-cell-arrow" @click="handleToPwd"> - <view class="menu-item-box"> - <view class="iconfont icon-password menu-icon"></view> - <view>淇敼瀵嗙爜</view> - </view> - </view> - - <view class="list-cell list-cell-arrow" @click="handleLogout"> - <view class="menu-item-box"> - <view class="iconfont icon-clean menu-icon"></view> - <view>閫�鍑虹櫥褰�</view> - </view> - </view> - - - </view> - - </view> --> - </view> + <!-- uView 寮圭獥 --> + <u-modal + :show="showPhonePopup" + title="缁戝畾鎵嬫満鍙�" + @confirm="confirmPhone" + @cancel="closePhonePopup" + confirm-color="#3AA0FF" + show-cancel-button + > + <view class="modal-content"> + <u-input + v-model="inputPhone" + placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" + type="number" + maxlength="11" + :border="true" + clearable + /> + </view> + </u-modal> + </view> + </view> </template> <script> - import { - getInfoById - } from "@/api/system/history"; - import { - getWxInfo - } from '@/api/login' - import { - bindPhone, - wxbindphone, - getIdCardByPhone - } from "@/api/login"; - import storage from '@/utils/storage' - import { - userInfo - } from 'os' - import { +import { getInfoById } from "@/api/system/history"; +import { getWxInfo, bindPhone, wxbindphone, getIdCardByPhone } from "@/api/login"; +import storage from '@/utils/storage'; +var WXBizDataCrypt = require('../../utils/WXBizDataCrypt'); - getIsPay - } from "@/api/system/cart"; - var WXBizDataCrypt = require('../../utils/WXBizDataCrypt') +export default { + data() { + return { + phone: "", // 鍒濆鍖栦负绌猴紝鏄剧ず鏈粦瀹氱姸鎬� + inputPhone: "", // 寮圭獥杈撳叆鐨勬墜鏈哄彿 + showPhonePopup: false, // 鎺у埗 uView 寮圭獥鏄剧ず + cusPhone: "", // 淇濈暀鍘熸暟鎹紙鍙Щ闄わ級 + globalData: { + codeitem: '', + phone: '', + }, + disapley: false, + userInfo: { + nickName: "", + avatar: "", + }, + name: this.$store.state.user.name, + token: this.$store.state.user.token, + version: getApp().globalData.config.appInfo.version + } + }, + computed: { + avatar() { + return this.$store.state.user.avatar; + }, + windowHeight() { + return uni.getSystemInfoSync().windowHeight - 50; + } + }, + onLoad() { + if (this.token) { + this.getList(); + getWxInfo().then(res => { + this.phone = res.data.phone || this.phone; // 鍒濆鍖栨椂鑾峰彇鎵嬫満鍙� + }); + } + }, + methods: { + getList() { - export default { - data() { - return { - phone: "", - cusPhone: "", - globalData: { - codeitem: '', // code - phone: '', //瑙e瘑鍚庣殑鎵嬫満鍙� - }, - disapley: false, - userInfo: { - nickName: "", - avatar: "", - }, //瀛樻斁鐢ㄦ埛淇℃伅 - name: this.$store.state.user.name, - token: this.$store.state.user.token, - version: getApp().globalData.config.appInfo.version - } - }, - - computed: { - avatar() { - return this.$store.state.user.avatar - }, - windowHeight() { - return uni.getSystemInfoSync().windowHeight - 50 - } - }, - onLoad: function() { - if (this.token) { - this.getList() - getWxInfo().then(res => { - this.cusPhone = res.data.phone - }) - } - - }, - methods: { - getList() { - getIsPay().then((res) => { - if (res) { - this.disapley = res.msg - } - - - }) - }, - - /* - 鎺堟潈璇ュ井淇$粦瀹氱殑鎵嬫満鍙� - */ - getPhoneNumber(e) { - let that = this - wx.login({ - success(res) { - console.log(res, 1111) - const sessionKey = uni.getStorageSync('sessionKey'); - const openId = uni.getStorageSync('openId'); - const iv = uni.getStorageSync('iv'); - const encryptedData = uni.getStorageSync('encryptedData'); - let data = { - code: e.detail.code, - sessionKey: sessionKey, - openId: openId, - iv: iv, - encryptedData: encryptedData, - } - bindPhone(data).then(response => { - uni.setStorageSync('msg', response.msg); - that.phone = response.msg - }) - } - }) - }, - /** - * 寰俊缁戝畾鐨勪釜浜轰俊鎭巿鏉� - */ - getWxToken() { - //鐢宠鎺堟潈 - uni.getUserProfile({ - desc: '鐢ㄤ簬瀹屽杽璧勬枡', // 澹版槑鑾峰彇鐢ㄦ埛涓汉淇℃伅鍚庣殑鐢ㄩ�旓紝鍚庣画浼氬睍绀哄湪寮圭獥涓紝璇疯皑鎱庡~鍐� - success: res => { - // console.log(res); - const sessionKey = uni.getStorageSync('sessionKey'); - const openId = uni.getStorageSync('openId'); - const iv = uni.getStorageSync('iv'); - const encryptedData = uni.getStorageSync('encryptedData'); - let data = { - openId: openId, - iv: iv, - encryptedData: encryptedData, - sessionKey: sessionKey - } - bindPhone(data).then(response => {}) - } - }) - - }, - //璋冨嚭 妯℃澘娑堟伅鐣岄潰 - subScriptionMessage() { - wx.requestSubscribeMessage({ - //妯℃澘id锛屽彲浠ュ啓澶氫釜 - tmplIds: ['M4K_BNVG7g4hOAcrIDO18ux8KOTneHeNide5GdPW3kc', - 'X467Xtd8HnFDNk-IoT0ChcdoBnClLZJQQwP7DMztYQ8', - 'Gzc2BgzSsEY9uki6FThNQRLD1_An6uqpSve3PaU58PQ', - - ], - //鎴愬姛鍥炶皟 - success(res) { - console.log(res); - }, - //澶辫触鍥炶皟 - fail(res) { - console.log(res); - } - }) - }, - questionnaire() { - const msg = uni.getStorageSync('msg'); - if (msg) { - let phone = msg; - getIdCardByPhone(phone).then(response => { - if (response.data) { - uni.setStorageSync('data', response.data); - const cusIdCard = uni.getStorageSync('data'); - uni.navigateTo({ - url: `/pages/visitrecord/visitrecord?cusIdCard=${cusIdCard}` - }) - } else { - uni.navigateTo({ - url: `/pages/questionnaire/questionnaire` - }) - } - }) - } else if (this.phone) { - let phone = this.phone; - getIdCardByPhone(phone).then(response => { - if (response.data) { - uni.setStorageSync('data', response.data); - const cusIdCard = uni.getStorageSync('data'); - uni.navigateTo({ - url: `/pages/visitrecord/visitrecord?cusIdCard=${cusIdCard}` - }) - } else { - uni.navigateTo({ - url: `/pages/questionnaire/questionnaire` - }) - } - }) - } else { - uni.navigateTo({ - url: `/pages/questionnaire/questionnaire` - }) - } - - }, - - getcusPhone() { - if (this.token) { - let data = { - openId: uni.getStorageSync('openId'), - phone: this.cusPhone - } - wxbindphone(data).then(res => { - this.$modal.showToast('缁戝畾鎴愬姛~') - }) - } else { - this.$tab.reLaunch('/pages/login') - } - - }, - history(canshu) { - uni.navigateTo({ - // url: `/pagesB/mine/myReservation/myReservation` - url: `/pagesB/mine/xuanzeyuanqv/xuanzeyuanqv?canshu=${canshu}&id=1` - }) - }, - handleToInfo() { - this.$tab.navigateTo('/pagesB/mine/info/index') - }, - handleToLogin() { - this.$tab.reLaunch('/pages/login') - }, - handleToAvatar() { - this.$tab.navigateTo('/pagesB/mine/avatar/index') - }, - handleLogout() { - this.$modal.confirm('纭畾娉ㄩ攢骞堕��鍑虹郴缁熷悧锛�').then(() => { - this.$store.dispatch('LogOut').then(() => { - this.$store.state.user.name = '' - this.$tab.reLaunch('/pages/index') - }) - }) - }, - handleHelp() { - this.$tab.navigateTo('/pagesB/mine/help/index') - }, - handleAbout() { - this.$tab.navigateTo('/pagesB/mine/about/index') - }, - handleJiaoLiuQun() { - this.$tab.navigateTo('/pagesB/mine/myReservation/myReservation') - }, - handleBuilding() { - const msg = uni.getStorageSync('msg'); - if (msg) { - let phone = msg; - getIdCardByPhone(phone).then(response => { - if (response.data) { - uni.setStorageSync('data', response.data); - const cusIdCard = uni.getStorageSync('data'); - uni.navigateTo({ - url: `/pages/tjrecord/tjrecord?cusIdCard=${cusIdCard}` - }) - } else { - uni.navigateTo({ - url: `/pagesA/Examiner/Examiner?id=2` - }) - } - }) - } else if (this.phone) { - let phone = this.phone; - getIdCardByPhone(phone).then(response => { - if (response.data) { - uni.setStorageSync('data', response.data); - const cusIdCard = uni.getStorageSync('data'); - uni.navigateTo({ - url: `/pages/tjrecord/tjrecord?cusIdCard=${cusIdCard}` - }) - } else { - uni.navigateTo({ - url: `/pagesA/Examiner/Examiner?id=2` - }) - } - }) - } else { - uni.navigateTo({ - url: `/pagesA/Examiner/Examiner?id=2` - }) - } - - }, - personnel(canshu) { - if (this.token) { - // this.$tab.navigateTo('/pagesA/Examiner/Examiner') - uni.navigateTo({ - url: `/pagesB/mine/xuanzeyuanqv/xuanzeyuanqv?canshu=${canshu}` - }) - } else { - this.$tab.reLaunch('/pages/login') - } - - }, - handleToPwd() { - this.$tab.navigateTo('/pagesB/mine/pwd/index') - }, - handleToUpgrade() { - this.$modal.showToast('褰撳墠鏄渶鏂扮増鏈摝~') - }, - handleCleanTmp() { - this.$modal.showToast('妯″潡寤鸿涓瓇') - }, - } - } + }, + getcusPhone() { + if (!this.token) { + this.$tab.reLaunch('/pages/login'); + return; + } + this.showPhonePopup = true; // 鏄剧ず uView 寮圭獥 + }, + closePhonePopup() { + this.inputPhone = ''; // 娓呯┖杈撳叆 + this.showPhonePopup = false; // 鍏抽棴寮圭獥 + }, + confirmPhone() { + const phoneRegex = /^1[3-9]\d{9}$/; + if (!phoneRegex.test(this.inputPhone)) { + this.$u.toast('璇疯緭鍏ユ湁鏁堢殑11浣嶆墜鏈哄彿鐮�'); + return; + } + const data = { phone: this.inputPhone }; + wxbindphone(data).then(res => { + this.phone = this.inputPhone; // 鏇存柊鏄剧ず鐨勬墜鏈哄彿 + this.$u.toast('缁戝畾鎴愬姛~'); + this.closePhonePopup(); // 鍏抽棴寮圭獥 + }).catch(err => { + this.$u.toast('缁戝畾澶辫触锛岃閲嶈瘯'); + }); + }, + getPhoneNumber(e) { + let that = this; + wx.login({ + success(res) { + console.log(res, 1111); + const sessionKey = uni.getStorageSync('sessionKey'); + const openId = uni.getStorageSync('openId'); + const iv = uni.getStorageSync('iv'); + const encryptedData = uni.getStorageSync('encryptedData'); + let data = { + code: e.detail.code, + sessionKey: sessionKey, + openId: openId, + iv: iv, + encryptedData: encryptedData, + }; + bindPhone(data).then(response => { + uni.setStorageSync('msg', response.msg); + that.phone = response.msg; + }); + } + }); + }, + getWxToken() { + uni.getUserProfile({ + desc: '鐢ㄤ簬瀹屽杽璧勬枡', + success: res => { + const sessionKey = uni.getStorageSync('sessionKey'); + const openId = uni.getStorageSync('openId'); + const iv = uni.getStorageSync('iv'); + const encryptedData = uni.getStorageSync('encryptedData'); + let data = { + openId: openId, + iv: iv, + encryptedData: encryptedData, + sessionKey: sessionKey + }; + bindPhone(data).then(response => {}); + } + }); + }, +subScriptionMessage() { + wx.requestSubscribeMessage({ + tmplIds: [ + 'M4K_BNVG7g4hOAcrIDO18ux8KOTneHeNide5GdPW3kc', + 'X467Xtd8HnFDNk-IoT0ChcdoBnClLZJQQwP7DMztYQ8', + 'Gzc2BgzSsEY9uki6FThNQRLD1_An6uqpSve3PaU58PQ', + ], + success: (res) => { + console.log('璁㈤槄娑堟伅缁撴灉:', res); + const tmplIds = [ + 'M4K_BNVG7g4hOAcrIDO18ux8KOTneHeNide5GdPW3kc', + 'X467Xtd8HnFDNk-IoT0ChcdoBnClLZJQQwP7DMztYQ8', + 'Gzc2BgzSsEY9uki6FThNQRLD1_An6uqpSve3PaU58PQ', + ]; + let acceptedCount = 0; + tmplIds.forEach(id => { + if (res[id] === 'accept') { + acceptedCount++; + } + }); + if (acceptedCount > 0) { + this.$u.toast(`鎴愬姛璁㈤槄`); + } else { + this.$u.toast('宸插彇娑�'); + } + }, + fail: (res) => { + console.error('璁㈤槄娑堟伅澶辫触:', res); + this.$u.toast('璁㈤槄娑堟伅澶辫触锛岃绋嶅悗閲嶈瘯'); + } + }); +}, + questionnaire() { + const msg = uni.getStorageSync('msg'); + if (msg) { + let phone = msg; + getIdCardByPhone(phone).then(response => { + if (response.data) { + uni.setStorageSync('data', response.data); + const cusIdCard = uni.getStorageSync('data'); + uni.navigateTo({ + url: `/pages/visitrecord/visitrecord?cusIdCard=${cusIdCard}` + }); + } else { + uni.navigateTo({ + url: `/pages/questionnaire/questionnaire` + }); + } + }); + } else if (this.phone) { + let phone = this.phone; + getIdCardByPhone(phone).then(response => { + if (response.data) { + uni.setStorageSync('data', response.data); + const cusIdCard = uni.getStorageSync('data'); + uni.navigateTo({ + url: `/pages/visitrecord/visitrecord?cusIdCard=${cusIdCard}` + }); + } else { + uni.navigateTo({ + url: `/pages/questionnaire/questionnaire` + }); + } + }); + } else { + uni.navigateTo({ + url: `/pages/questionnaire/questionnaire` + }); + } + }, + history(canshu) { + uni.navigateTo({ + url: `/pagesB/mine/xuanzeyuanqv/xuanzeyuanqv?canshu=${canshu}&id=1` + }); + }, + handleToInfo() { + this.$tab.navigateTo('/pagesB/mine/info/index'); + }, + handleToLogin() { + this.$tab.reLaunch('/pages/login'); + }, + handleToAvatar() { + this.$tab.navigateTo('/pagesB/mine/avatar/index'); + }, + handleLogout() { + this.$u.modal({ + content: '纭畾娉ㄩ攢骞堕��鍑虹郴缁熷悧锛�', + showCancel: true, + confirmText: '纭畾', + cancelText: '鍙栨秷' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + this.$store.state.user.name = ''; + this.phone = ''; // 閫�鍑虹櫥褰曟椂娓呯┖鎵嬫満鍙� + this.$tab.reLaunch('/pages/index'); + }); + }); + }, + handleHelp() { + this.$tab.navigateTo('/pagesB/mine/help/index'); + }, + handleAbout() { + this.$tab.navigateTo('/pagesB/mine/about/index'); + }, + handleJiaoLiuQun() { + this.$tab.navigateTo('/pagesB/mine/myReservation/myReservation'); + }, + handleBuilding() { + // 浼樺厛浠� uni.getStorageSync 鑾峰彇 phone锛岃嫢鏃犲垯浣跨敤 this.phone + const phone = uni.getStorageSync('msg') || this.phone; + + // 濡傛灉 phone 涓嶅瓨鍦紝鐩存帴璺宠浆鍒� Examiner 椤甸潰 + if (!phone) { + uni.navigateTo({ + url: '/pagesA/Examiner/Examiner?id=2' + }); + return; + } + + // 璋冪敤 API 鑾峰彇韬唤璇佸彿 + getIdCardByPhone(phone) + .then(response => { + if (response.data) { + // 瀛樺偍韬唤璇佸彿骞惰烦杞埌 tjrecord 椤甸潰 + uni.setStorageSync('data', response.data); + uni.navigateTo({ + url: `/pages/tjrecord/tjrecord?cusIdCard=${response.data}` + }); + } else { + // 鏃犳暟鎹椂璺宠浆鍒� Examiner 椤甸潰 + uni.navigateTo({ + url: '/pagesA/Examiner/Examiner?id=2' + }); + } + }) + .catch(err => { + console.error('getIdCardByPhone 閿欒:', err); + uni.showToast({ + title: err.message || '缃戠粶閿欒锛岃绋嶅悗閲嶈瘯', + icon: 'none' + }); + // 鍙�夛細鏍规嵁闇�姹傚喅瀹氭槸鍚﹁烦杞� + uni.navigateTo({ + url: '/pagesA/Examiner/Examiner?id=2' + }); + }); + }, + personnel(canshu) { + if (this.token) { + uni.navigateTo({ + url: `/pagesB/mine/xuanzeyuanqv/xuanzeyuanqv?canshu=${canshu}` + }); + } else { + this.$tab.reLaunch('/pages/login'); + } + }, + handleToPwd() { + this.$tab.navigateTo('/pagesB/mine/pwd/index'); + }, + handleToUpgrade() { + this.$u.toast('褰撳墠鏄渶鏂扮増鏈摝~'); + }, + handleCleanTmp() { + this.$u.toast('妯″潡寤鸿涓瓇'); + }, + } +} </script> <style lang="scss"> - page { - height: 100%; - background-color: #F5F6FA; - } - - .page { - height: 100%; - } - - .bg-image { - position: absolute; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - z-index: -1; - left: 50%; - transform: translateX(-50%); - object-fit: cover; - } - .container { - min-height: 100%; - display: flex; - flex-direction: column; - padding: 0 30rpx; - box-sizing: border-box; - padding-bottom: 120rpx; - } - - /* 鐢ㄦ埛淇℃伅鍖哄煙鏍峰紡 */ - .user-info { - display: flex; - justify-content: space-between; - align-items: center; - padding: 30rpx 0; - } - - .user-info__left { - display: flex; - align-items: center; - } - - .avatar { - width: 120rpx; - height: 120rpx; - border-radius: 60rpx; - margin-right: 20rpx; - } - - .user-info__content { - display: flex; - flex-direction: column; - } - - .name-wrapper { - display: flex; - align-items: center; - margin-bottom: 10rpx; - } - - .name { - font-size: 32rpx; - color: #333; - font-weight: 500; - margin-right: 16rpx; - } - - .certified { - background-color: #FFB442; - color: #fff; - font-size: 24rpx; - padding: 4rpx 12rpx; - border-radius: 4rpx; - } - - .phone { - font-size: 28rpx; - color: #999; - } - - .user-info__right { - display: flex; - align-items: center; - } - - .personal-info { - font-size: 28rpx; - color: #3AA0FF; - margin-right: 8rpx; - } - - /* 蹇嵎鍔熻兘鍖烘牱寮� */ - .quick-functions { - display: flex; - justify-content: space-between; - padding: 40rpx; - background-color: #fff; - border-radius: 16rpx; - margin-bottom: 30rpx; - width: 702rpx; - height: 186rpx; - background: linear-gradient( 90deg, #FFFFFF 0%, #FCFFFE 100%); - box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127,153,177,0.14); - border-radius: 12rpx 12rpx 12rpx 12rpx; - } - - .function-item { - display: flex; - flex-direction: column; - align-items: center; - } - - .function-icon { - width: 96rpx; - height: 96rpx; - background-color: #F5F7FA; - border-radius: 48rpx; - display: flex; - justify-content: center; - align-items: center; - margin-bottom: 16rpx; - } - .icon-img{ - width: 45.03rpx; - height: 52rpx; - // background-color: #F5F7FA; - // border-radius: 48rpx; - display: flex; - justify-content: center; - align-items: center; - margin-bottom: 16rpx; - } - .function-text { - font-size: 28rpx; - color: #333; - } - - /* 甯哥敤宸ュ叿鍖烘牱寮� */ - .tools-section { - background-color: #fff; - border-radius: 16rpx; - padding: 30rpx; - margin-bottom: 30rpx; - } - - .tools-title { - font-size: 32rpx; - color: #333; - font-weight: 500; - margin-bottom: 30rpx; - } - - .tool-item { - display: flex; - justify-content: space-between; - align-items: center; - padding: 24rpx 0; - // border-bottom: 1px solid #f5f5f5; - } - - .tool-item:last-child { - border-bottom: none; - } - - .tool-item__left { - display: flex; - align-items: center; - } - - .tool-text { - font-size: 28rpx; - color: #333; - margin-left: 20rpx; - } - - .tool-item__right { - display: flex; - align-items: center; - } - - .status { - font-size: 24rpx; - margin-right: 8rpx; - } - - .confirmed { - width: 38px; - line-height: 20px; - background-color: #E8F8FA; - text-align: center; - border-radius: 10rpx; - color: #3AA0FF; - } - - .allowed { - width: 38px; - line-height: 20px; - background-color: #E8F8FA; - text-align: center; - border-radius: 10rpx; - color: #3AA0FF; - } - - /* 鎶�鏈敮鎸佷俊鎭牱寮� */ - .tech-support { - font-weight: 300; - font-size: 24rpx; - color: #B4B4B4; - line-height: 20rpx; - text-align: center; - } - - .rt-image{ - width: 28rpx; - height: 26rpx; - margin-left: 10rpx; - } - - .tech-support text { - font-size: 24rpx; - color: #999; - } +page { + height: 100%; + background-color: #F5F6FA; +} - .mine-container { - width: 100%; - height: 100%; +.page { + height: 100%; +} - .header-section { - width: 120rpx; - height: 120rpx; - // border-radius: 60rpx; - // margin-right: 20rpx; - padding: 15px 15px 45px 15px; - background: linear-gradient(180deg, #fd8b4d, #f4f8f7, #f7f7f7 255%, ); - color: white; +.bg-image { + position: absolute; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: -1; + left: 50%; + transform: translateX(-50%); + object-fit: cover; +} - .login-tip { - font-size: 18px; - margin-left: 10px; - } +.container { + min-height: 100%; + display: flex; + flex-direction: column; + padding: 0 30rpx; + box-sizing: border-box; + padding-bottom: 120rpx; +} - .cu-avatar { - border: 2px solid #eaeaea; +/* 鐢ㄦ埛淇℃伅鍖哄煙鏍峰紡 */ +.user-info { + display: flex; + justify-content: space-between; + align-items: center; + padding: 30rpx 0; +} - .icon { - font-size: 40px; - } - } +.user-info__left { + display: flex; + align-items: center; +} - .user-info { - margin-left: 15px; +.avatar { + width: 120rpx; + height: 120rpx; + border-radius: 60rpx; + margin-right: 20rpx; +} - .u_title { - font-size: 18px; - line-height: 30px; - } - } - } +.user-info__content { + display: flex; + flex-direction: column; +} - .content-section { - position: relative; - top: -50px; +.name-wrapper { + display: flex; + align-items: center; + margin-bottom: 10rpx; +} - .mine-actions { - margin: 15px 15px; - padding: 20px 0px; - border-radius: 8px; - background-color: white; +.name { + font-size: 32rpx; + color: #333; + font-weight: 500; + margin-right: 16rpx; +} - .action-item { - .icon { - font-size: 28px; - } +.certified { + background-color: #FFB442; + color: #fff; + font-size: 24rpx; + padding: 4rpx 12rpx; + border-radius: 4rpx; +} - .text { - display: block; - font-size: 13px; - margin: 8px 0px; - } - } - } - } - } +.phone { + font-size: 28rpx; + color: #999; +} + +.user-info__right { + display: flex; + align-items: center; +} + +.personal-info { + font-size: 28rpx; + color: #3AA0FF; + margin-right: 8rpx; +} + +/* 蹇嵎鍔熻兘鍖烘牱寮� */ +.quick-functions { + display: flex; + justify-content: space-between; + padding: 40rpx; + background-color: #fff; + border-radius: 16rpx; + margin-bottom: 30rpx; + width: 702rpx; + height: 186rpx; + background: linear-gradient(90deg, #FFFFFF 0%, #FCFFFE 100%); + box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127,153,177,0.14); +} + +.function-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.icon-img { + width: 45.03rpx; + height: 52rpx; + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 16rpx; +} + +.function-text { + font-size: 28rpx; + color: #333; +} + +/* 甯哥敤宸ュ叿鍖烘牱寮� */ +.tools-section { + background-color: #fff; + border-radius: 16rpx; + padding: 30rpx; + margin-bottom: 30rpx; +} + +.tools-title { + font-size: 32rpx; + color: #333; + font-weight: 500; + margin-bottom: 30rpx; +} + +.tools-list { + display: flex; + flex-direction: column; +} + +.tool-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 24rpx 0; +} + +.tool-item:last-child { + border-bottom: none; +} + +.tool-item__left { + display: flex; + align-items: center; +} + +.tool-text { + font-size: 28rpx; + color: #333; + margin-left: 20rpx; +} + +.tool-item__right { + display: flex; + align-items: center; +} + +.status { + font-size: 24rpx; + margin-right: 8rpx; +} + +.confirmed { + width: 38px; + line-height: 20px; + background-color: #E8F8FA; + text-align: center; + border-radius: 10rpx; + color: #3AA0FF; +} + +.allowed { + width: 38px; + line-height: 20px; + background-color: #E8F8FA; + text-align: center; + border-radius: 10rpx; + color: #3AA0FF; +} + +/* 鎶�鏈敮鎸佷俊鎭牱寮� */ +.tech-support { + font-weight: 300; + font-size: 24rpx; + color: #B4B4B4; + line-height: 20rpx; + text-align: center; +} + +.rt-image { + width: 28rpx; + height: 26rpx; + margin-left: 10rpx; +} + +.tech-support text { + font-size: 24rpx; + color: #999; +} + +/* uView 寮圭獥鍐呭鏍峰紡 */ +.modal-content { + padding: 20rpx; +} </style> \ No newline at end of file -- Gitblit v1.8.0