tianyi 1 day ago
parent
commit
9513d4a37f
  1. 81
      components/tab-bar/myCenter.vue

81
components/tab-bar/myCenter.vue

@ -6,10 +6,12 @@
<view style="margin-top: 80px;" v-if="worker" @click="navigatorTo('jianzhizhuye')">兼职主页-{{workerCounts}}</view>
<view style="margin-top: 80px;" @click="navigatorTo('qianbao')">钱包余额 {{balance}}</view>
<view style="margin-top: 80px;" @click="navigatorTo('dingdan')">我的订单</view>
<view style="margin-top: 80px;" @click="navigatorTo('qiehuan')">切换校区放到设置中</view>
<!-- 未注册兼职弹窗 -->
<uni-popup ref="jianzhiPopup" background-color="rgba(2, 171, 255, 1)" borderRadius="40px 40px 40px 40px">
<view class="jianzhi-content" @tap="navigatorTo('partTimeReg')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/faf25c687bc1417282ebac719fd1bfba.png" alt="" style="width: 100%;height: 100%;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/faf25c687bc1417282ebac719fd1bfba.png" alt=""
style="width: 100%;height: 100%;">
<view style="position: absolute;bottom: -50px;left: 130px;" @tap.stop="$refs.jianzhiPopup.close()">
<uni-icons type="close" size="40" color="#fff"></uni-icons>
</view>
@ -26,6 +28,17 @@
</view>
</view>
</uni-popup>
<!-- 弹出区域选择 -->
<uni-popup ref="areaPopup" background-color="#fff">
<view class="popup-area-content">
<view class="popup-area-title">
<text>请选择所属区域</text>
</view>
<view class="popup-area-container" v-for="(item,index) in areaList" @tap="onClickArea(item)">
<text style="display: inline-block">{{item.title}}</text>
</view>
</view>
</uni-popup>
</view>
</template>
@ -33,6 +46,7 @@
export default {
data() {
return {
areaList:[],
schoolShop: [],
workerCounts: 0,
shopCounts: 0,
@ -62,7 +76,9 @@
this.shopCounts = uni.getStorageSync('shopCounts')
}
this.balance = 0
this.tui.request("/worker/getAllDepo/", "GET", {userId:uni.getStorageSync('id')}, false, true).then((res) => {
this.tui.request("/worker/getAllDepo/", "GET", {
userId: uni.getStorageSync('id')
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result.user) {
this.balance += Number(res.result.user.depoBal)
@ -90,11 +106,28 @@
uni.setStorageSync('shopIcon', item.shopIcon)
uni.setStorageSync('shopScore', item.shopScore)
uni.setStorageSync('shopTakeaway', item.shopTakeaway)
uni.setStorageSync('attrId', item.attrId)
this.$refs.shopPopup.close()
uni.navigateTo({
url: '/package2/shop/merchantCenter'
})
},
checkArea() {
this.tui.request("/app/shopArea/getByParentId/0", "get", {}, false, false).then((res) => {
if (res.code == 200) {
this.areaList = res.result
this.$refs.areaPopup.open()
} else {
this.tui.toast(res.message)
}
})
},
onClickArea(item) {
uni.setStorageSync('area', JSON.stringify(item))
this.tui.toast('切换成功')
this.$refs.areaPopup.close()
},
navigatorTo(e, index) {
let url = ""
if (e == 'addgoods') {
@ -141,18 +174,25 @@
url = '/package2/myCenter/goodsList'
} else if (e == 'merchant') {
url = '/package2/shop/merchantRegister'
} else if (e == 'qiehuan') {
this.checkArea()
} else if (e == 'jianzhichaping') {
let item = {
shopScore: uni.getStorageSync('worker').score,
id: uni.getStorageSync('worker').workerId
}
url = '/package2/group/shopEvaluate?item=' + JSON.stringify(item) + '&isMerchant=2&isCha=' + (index =='cha'?1:0)
url = '/package2/group/shopEvaluate?item=' + JSON.stringify(item) + '&isMerchant=2&isCha=' + (index ==
'cha' ? 1 : 0)
} else if (e == 'partTimeReg') {
let worker = uni.getStorageSync('worker')
let that = this
//
if (worker == undefined || worker == '' || worker == null) {
that.tui.request("/worker/admin/add", "POST", {userId:uni.getStorageSync('id'),isChangeArea:1,region:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res) => {
that.tui.request("/worker/admin/add", "POST", {
userId: uni.getStorageSync('id'),
isChangeArea: 1,
region: JSON.parse(uni.getStorageSync('area')).id
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result != null) {
uni.setStorageSync('worker', res.result)
@ -196,16 +236,19 @@
height: 100%;
font-size: 28rpx;
}
.page1 {
width: 100%;
height: 100%;
font-size: 28rpx;
}
.jianzhi-content {
width: 300px;
height: 350px;
position: relative;
}
.shop-content {
width: 300px;
height: auto;
@ -214,6 +257,7 @@
border-radius: 10px;
padding: 10px;
}
.popup-pay-title {
font-size: 36rpx;
font-weight: bold;
@ -223,6 +267,7 @@
border-bottom: 1px solid #eee;
margin-bottom: 10px;
}
.popup-list {
height: 30px;
text-align: center;
@ -231,4 +276,32 @@
border-bottom: 1px solid #eee;
line-height: 30px;
}
.popup-area-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: auto;
background-color: #fff;
}
.popup-area-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-area-container {
margin-top: 20rpx;
height: 100rpx;
border-radius: 10px;
background: #088FEB;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
color: #fff;
}
</style>
Loading…
Cancel
Save