small-program/App.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
small-program/components/sunui-mverify/sunui-mverify.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
small-program/pages/demand-hall/demand-hall.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
small-program/pages/employment-certification/employment-certification.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
small-program/pages/index/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
small-program/pages/mine/mine.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
small-program/store/index.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
small-program/utils/http.interceptor.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
small-program/App.vue
@@ -12,30 +12,61 @@ success: async function (loginRes) { let { code } = loginRes; let res = await that.$u.api.wxLogin({ code }) if (res&& res.code === 200) { if (res && res.code === 200) { that.$store.commit('setToken', res.data.token) that.$store.commit('setOpenid', res.data.openid) that.$store.commit('setUserInfo', res.data.member) that.$isResolve() uni.getLocation({ type: 'wgs84', success: (addr) => { that.$store.commit('setPosition', { latitude: addr.latitude, longitude: addr.longitude }) that.$isResolve() }, fail: (err) => { console.error('获取位置失败', err); that.$isResolve() } }); } } }); } } else { var that = this let res = this.$u.api.getMemberInfo({}).then(res =>{ if (res && res.code === 200) { that.$store.commit('setUserInfo', res.data) uni.getLocation({ type: 'wgs84', success: (addr) => { that.$store.commit('setPosition', { latitude: addr.latitude, longitude: addr.longitude }) that.$isResolve() }, fail: (err) => { console.error('获取位置失败', err); that.$isResolve() } }); } else { that.$store.commit('setToken','') that.$store.commit('setUserInfo',{}) uni.getLocation({ type: 'wgs84', success: (addr) => { that.$store.commit('setPosition', { latitude: addr.latitude, longitude: addr.longitude }) that.$isResolve() }, fail: (err) => { console.error('获取位置失败', err); that.$isResolve() } }); } }) } }, onShow: function() { console.log('App Show') var that =this let res = this.$u.api.getMemberInfo({}).then(res =>{ if (res && res.code ===200) { that.$store.commit('setUserInfo', res.data) that.$isResolve() }else{ that.$store.commit('setToken','') that.$store.commit('setUserInfo',{}) that.$isResolve() } }) }, onHide: function() { console.log('App Hide') small-program/components/sunui-mverify/sunui-mverify.vue
@@ -1,7 +1,7 @@ <template name='sunui-mverify'> <view class="sunui-slider"> <text style="color: #FFFFFF;">{{ hint }}</text> <view class='sunui-slider-bg' :style="{left:-(w + 2)+'px',transform:cssAnimation}"> <view class='sunui-slider-bg' :style="{left:-(w + 5)+'px',transform:cssAnimation}"> <text>{{ succeedMsg }}</text> <view class='sunui-slider-box' @touchmove='moveStart' @touchend='moveEnd'> <image src="/static/icon/ic_huakuai@2x.png" mode="widthFix"></image> small-program/pages/demand-hall/demand-hall.vue
@@ -6,278 +6,276 @@ <text>我的订单</text> </view> </view> <!-- 发单方 --> <view class="index-labs" v-if="type === 0" :style="{ top: statusbarHeight + navHeight + 'px' }"> <view class="index-labs-row"> 全部 <view class="index-labs-row-x"></view> </view> <view class="index-labs-row active">待接单</view> <view class="index-labs-row">已接单</view> <view class="index-labs-row">进行中</view> <view class="index-labs-row">待评价</view> <view class="index-labs-row">已取消</view> </view> <!-- 接单方 --> <view class="index-labs" v-if="type === 1" :style="{ top: statusbarHeight + navHeight + 'px' }"> <view class="index-labs-row"> 全部 <view class="index-labs-row-x"></view> </view> <view class="index-labs-row active">已接单</view> <view class="index-labs-row">进行中</view> <view class="index-labs-row">已完成</view> <view class="index-labs-row">已取消</view> </view> <!-- 发单方 --> <view class="index-list" v-if="type === 0"> <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>订餐单</text> </view> <view class="index-list-item-head-r">待接单方接单</view> </view> <view class="index-list-item-info"> 午餐5元(30份)|晚餐8元(20份) </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>运货单-小货车-厢式</text> </view> <view class="index-list-item-head-r">待接单方接单</view> </view> <view class="index-list-item-info"> 葡萄|20000斤|需2辆 </view> <view class="index-list-item-date"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="address"> <view class="address-xian"></view> <view class="address-row"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园东门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image> <text>安徽莲花科技产业园豆米科技有限公司</text> </view> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>用工单-采摘工</text> </view> <view class="index-list-item-head-r">待接单</view> </view> <view class="index-list-item-info"> 葡萄|2000斤 </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> </view> <!-- 接单方 --> <view class="index-list" v-if="type === 1"> <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>订餐单</text> <view class="tips">系统派单</view> </view> <view class="index-list-item-head-r">已接单</view> </view> <view class="index-list-item-info"> 午餐5元(30份)|晚餐8元(20份) </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view class="eidt-tips"> <image src="/static/icon/ic_tip@2x.png" mode="widthFix"></image> <text>订单已修改</text> </view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>运货单-小货车-厢式</text> <view class="tips1">自主抢单</view> </view> <view class="index-list-item-head-r">已接单</view> </view> <view class="index-list-item-info"> 葡萄|20000斤|需2辆 </view> <view class="index-list-item-date"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="address"> <view class="address-xian"></view> <view class="address-row"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园东门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image> <text>安徽莲花科技产业园豆米科技有限公司</text> </view> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>用工单-采摘工</text> <view class="tips1">自主抢单</view> </view> <view class="index-list-item-head-r">待接单</view> </view> <view class="index-list-item-info"> 葡萄|2000斤 </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> </view> <!-- <view class="index-wu"> <!-- 未登录 --> <view class="index-wu" v-if="!isLogin"> <image src="/static/icon/default_login@2x.png" mode="widthFix"></image> <text>您还没有登录,请登录后查看订单</text> <button>登录</button> </view> --> </view> <!-- 已登陆 --> <template v-else> <!-- 发单方 --> <view class="index-labs" v-if="typeViewId === 0" :style="{ top: statusbarHeight + navHeight + 'px' }"> <scroll-view scroll-x class="scroll-view_H"> <view :class="item.id === status ? 'index-labs-row active' : 'index-labs-row'" v-for="(item, index) in list1" :key="index" @click="clickOrderType(item.id)"> {{item.name}} <view class="index-labs-row-x" v-if="item.id === status"></view> </view> </scroll-view> </view> <!-- 接单方 --> <view class="index-labs" v-if="typeViewId === 1" :style="{ top: statusbarHeight + navHeight + 'px' }"> <scroll-view scroll-x class="scroll-view_H"> <view :class="item.id === status ? 'index-labs-row active' : 'index-labs-row'" v-for="(item, index) in list" :key="index" @click="clickOrderType(item.id)"> {{item.name}} <view class="index-labs-row-x" v-if="item.id === status"></view> </view> </scroll-view> </view> <!-- 发单方 --> <view class="index-list" v-if="typeViewId === 0"> <view class="index-list-item" v-for="(item, index) in orderList" :key="index"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text v-if="item.type === 0 && item.workType === 0">用工单 - 采摘工</text> <text v-else-if="item.type === 0 && item.workType === 1">用工单 - 分拣工</text> <text v-else-if="item.type === 0 && item.workType === 2">用工单 - 包装工</text> <text v-else-if="item.type === 1">运货单-{{item.categoryName}}-{{item.carUnit}}</text> <text v-else-if="item.type === 2">订餐单</text> </view> <view class="index-list-item-head-r" v-if="item.status === 1">待接单方接单</view> <view class="index-list-item-head-r" v-if="item.status === 2">已接单</view> <view class="index-list-item-head-r" v-if="item.status === 3">进行中</view> <view class="index-list-item-head-r" v-if="item.status === 2 && item.isUpdate === 1">已修改,待接单方确认</view> <view class="index-list-item-head-r hui" v-if="item.status === 4">已完成</view> <view class="index-list-item-head-r hui" v-if="item.status === 99">已取消</view> <view class="index-list-item-head-r" v-if="item.status === 4 && item.commentStatus === 0">待评价</view> </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 0"> {{item.categoryName}}|{{item.priceNum1}}斤 </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 1"> {{item.categoryName}}|{{item.priceNum1}}人 </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2"> {{item.categoryName}}|{{item.priceNum1}}人 </view> <view class="index-list-item-info" v-if="item.type === 1"> {{item.transportTypeName}} | {{item.transportNum}}{{item.transportUnit}}|用车{{item.priceNum1}}天 </view> <view class="index-list-item-info" v-if="item.type === 2"> {{item.wayInfoCopy}} </view> <view class="address" v-if="item.type === 1"> <view class="address-xian"></view> <view class="address-row" v-for="(address, i) in item.wayInfo" :key="i"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix" v-if="i === 0"></image> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix" v-else-if="i !== 0 && i !== item.wayInfo.length - 1"></image> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix" v-else-if="i === item.wayInfo.length - 1"></image> <text>{{item.location}}</text> </view> </view> <template v-if="[0, 2].includes(item.type)"> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>{{item.location}}</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>{{item.startDate}} 至 {{item.endDate}}({{item.priceNum1}}天)</text> </view> </template> <view class="index-list-item-price"> <text>预估:</text> <text>¥{{item.estimatedAccount / 100}}</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close" v-if="[0,1,2].includes(item.status)" @click="orderId = item.id, show = true">取消订单</view> <view class="eidt-phone" v-if="[2].includes(item.status)">联系师傅</view> <view class="eidt-phone" v-if="item.status === 4 && item.commentStatus === 0">评价订单</view> <view class="eidt-btn" v-if="[0,1,2].includes(item.status)" @click="jumpEdit(item)">修改订单</view> <view class="eidt-btn" v-if="(item.type === 2 && item.status === 0) || (item.type === 2 && item.status === 3)" @click="jumpEdit(item)">继续支付</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> </view> <!-- 接单方 --> <view class="index-list" v-if="typeViewId === 1"> <view class="index-list-item" v-for="(item, index) in orderList" :key="index"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text v-if="item.type === 0 && item.workType === 0">用工单 - 采摘工</text> <text v-else-if="item.type === 0 && item.workType === 1">用工单 - 分拣工</text> <text v-else-if="item.type === 0 && item.workType === 2">用工单 - 包装工</text> <text v-else-if="item.type === 1">运货单-{{item.categoryName}}-{{item.carUnit}}</text> <text v-else-if="item.type === 2">订餐单</text> <view class="tips" v-if="item.acceptType === 1">系统派单</view> <view class="tips1" v-if="item.acceptType === 0">手动接单</view> </view> <view class="index-list-item-head-r" v-if="item.status === 2">已接单</view> <view class="index-list-item-head-r" v-if="item.status === 3">进行中</view> <view class="index-list-item-head-r hui" v-if="item.status === 4">已完成</view> <view class="index-list-item-head-r hui" v-if="item.status === 99">已取消</view> </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 0"> {{item.categoryName}}|{{item.priceNum1}}斤 </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 1"> {{item.categoryName}}|{{item.priceNum1}}人 </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2"> {{item.categoryName}}|{{item.priceNum1}}人 </view> <view class="index-list-item-info" v-if="item.type === 1"> {{item.transportTypeName}} | {{item.transportNum}}{{item.transportUnit}}|用车{{item.priceNum1}}天 </view> <view class="index-list-item-info" v-if="item.type === 2"> {{item.wayInfoCopy}} </view> <view class="address" v-if="item.type === 1"> <view class="address-xian"></view> <view class="address-row" v-for="(address, i) in item.wayInfo" :key="i"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix" v-if="i === 0"></image> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix" v-else-if="i !== 0 && i !== item.wayInfo.length - 1"></image> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix" v-else-if="i === item.wayInfo.length - 1"></image> <text>{{item.location}}</text> </view> </view> <template v-if="[0, 2].includes(item.type)"> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>{{item.location}}</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>{{item.startDate}} 至 {{item.endDate}}({{item.priceNum1}}天)</text> </view> </template> <view class="index-list-item-price"> <text>预估:</text> <text>¥{{item.estimatedAccount / 100}}</text> </view> <view class="eidt"> <view class="eidt-tips" v-if="item.isUpdate === 1"> <image src="/static/icon/ic_tip@2x.png" mode="widthFix"></image> <text>订单已修改</text> </view> <view class="eidt-tips" v-else></view> <view class="eidt-right"> <view class="eidt-close" v-if="item.status === 2" @click="orderId = item.id, show = true">取消订单</view> <view class="eidt-phone" v-if="[2,3].includes(item.status)" @click="phoneCall(item.linkPhone)">联系业主</view> <!-- <view class="eidt-close">删除订单</view> <view class="eidt-phone">联系师傅</view> <view class="eidt-phone">评价订单</view> <view class="eidt-btn">修改订单</view> <view class="eidt-btn">完成并支付</view> --> </view> </view> </view> <!-- <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>运货单-小货车-厢式</text> <view class="tips1">自主抢单</view> </view> <view class="index-list-item-head-r">已接单</view> </view> <view class="index-list-item-info"> 葡萄|20000斤|需2辆 </view> <view class="index-list-item-date"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="address"> <view class="address-xian"></view> <view class="address-row"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园东门保安室</text> </view> <view class="address-row"> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix"></image> <text>安徽莲花科技产业园豆米科技有限公司</text> </view> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> </view> </view> </view> --> <!-- <view class="index-list-item"> <view class="index-list-item-head"> <view class="index-list-item-head-l"> <view class="xoam"></view> <text>用工单-采摘工</text> <view class="tips1">自主抢单</view> </view> <view class="index-list-item-head-r">待接单</view> </view> <view class="index-list-item-info"> 葡萄|2000斤 </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>长江西路大蜀山森林公园西门保安室</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>07-26 至 07-27(2天)</text> </view> <view class="index-list-item-price"> <text>预估:</text> <text>¥1000.00</text> </view> <view class="eidt"> <view></view> <view class="eidt-right"> <view class="eidt-close">取消订单</view> </view> </view> </view> --> </view> </template> <u-modal title="温馨提示" :show="show" closeOnClickOverlay showCancelButton > <view class="slot-content"> 确认取消订单吗? </view> <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;"> <view class="btn1" @click="show = false">我再想想</view> <view class="btn2" @click="cancelOrder">确认取消</view> </view> </u-modal> </view> </template> @@ -285,12 +283,143 @@ import { mapState } from 'vuex' export default { computed: { ...mapState(['navHeight', 'statusbarHeight']) ...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid', 'latitude', 'longitude']) }, onShow(options) { this.typeViewId = 0 if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){ this.isLogin = true } if (this.userInfo && this.userInfo.useIdentity == 1) { this.typeViewId = 1 } else { this.typeViewId = 0 } }, data() { return { type: 1 show: false, isLogin: false, typeViewId: 0, list: [ { name: '全部', id: '' }, { name: '已接单', id: 2 }, { name: '进行中', id: 3 }, { name: '已完成', id: 4 }, { name: '已取消', id: 99 }, ], list1: [ { name: '全部', id: '' }, { name: '待支付', id: 0 }, { name: '待接单', id: 1 }, { name: '已接单', id: 2 }, { name: '进行中', id: 3 }, { name: '已完成', id: 4 }, { name: '已取消', id: 99 }, { name: '待评价', id: [4, 0] } ], orderId: null, status: '', commentStatus: '', next: true, page: 1, orderList: [] }; }, async onLoad() { await this.$onLaunched; uni.$on('refresh', (data) => { console.log('我的订单页刷新'); this.status = '' this.commentStatus = '' this.orderList = [] this.next = true this.page = 1 this.getOrderList() }) this.getOrderList() }, onReachBottom() { this.getOrderList() }, methods: { // 修改 jumpEdit(item) { if (item.type === 0 && item.workType === 0) { uni.navigateTo({ url: `/pages/using-workers/using-workers?id=${item.id}` }) } else if (item.type === 0 && item.workType === 1) { uni.navigateTo({ url: `/pages/sorting/sorting?id=${item.id}` }) } else if (item.type === 0 && item.workType === 2) { uni.navigateTo({ url: `/pages/packaging-worker/packaging-worker?id=${item.id}` }) } }, cancelOrder() { this.$u.api.receiveCancelOrder({ orderId: this.orderId }).then(res => { this.show = false this.orderList = [] this.next = true this.page = 1 this.getOrderList() }) }, phoneCall(phoneNumber) { uni.makePhoneCall({ phoneNumber }); }, // 订单分页 getOrderList() { if (!this.next) return; this.$u.api.orderPage({ capacity: 10, page: this.page, model: { queryMyOrderType: this.userInfo.useIdentity, status: this.status, queryLat: this.latitude, queryLgt: this.longitude } }).then(res => { res.data.records.forEach(item => { // 订餐单 if (item.type === 2) { item.wayInfoCopy = JSON.parse(item.wayInfo).map(item => { return `${item.name}${item.price / 100}元(${item.num}份)` }).join(' | ') // 运货 } else if (item.type === 1) { item.wayInfo = JSON.parse(item.wayInfo) } }) this.orderList = [...this.orderList, ...res.data.records] if (this.orderList.length === res.data.total) { this.next = false } }) }, clickOrderType(id) { if (typeof id === 'object') { this.status = id[0] this.commentStatus = id[1] } else { this.commentStatus = '' this.status = id } this.orderList = [] this.next = true this.page = 1 this.getOrderList() } } } </script> @@ -304,6 +433,36 @@ <style lang="scss" scoped> .index { width: 100%; .slot-content { width: 100%; text-align: center; font-weight: 400; font-size: 30rpx; color: #333333; margin: 30rpx 0; } .btn1 { width: 264rpx; height: 88rpx; line-height: 88rpx; text-align: center; font-weight: 400; font-size: 32rpx; color: #666666; border-radius: 44rpx; border: 1rpx solid #B2B2B2; } .btn2 { width: 264rpx; height: 88rpx; line-height: 88rpx; text-align: center; font-weight: 500; font-size: 32rpx; color: #FFFFFF; background: #00BC12; border-radius: 44rpx; } .index-j-head { width: 100%; background-color: #ffffff; @@ -358,38 +517,47 @@ color: #FF0000; } } .eidt-close { width: 160rpx; height: 64rpx; font-weight: 400; font-size: 28rpx; color: #666666; line-height: 64rpx; text-align: center; border-radius: 34rpx; border: 1rpx solid #B2B2B2; } .eidt-phone { width: 160rpx; height: 64rpx; line-height: 64rpx; text-align: center; font-weight: 400; font-size: 28rpx; color: #00BC12; border-radius: 34rpx; border: 1rpx solid #00BC12; } .eidt-btn { width: 160rpx; height: 64rpx; line-height: 64rpx; text-align: center; font-weight: 400; font-size: 28rpx; color: #FFFFFF; background: #00BC12; border-radius: 34rpx; .eidt-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; .eidt-close { width: 160rpx; height: 64rpx; font-weight: 400; font-size: 28rpx; color: #666666; line-height: 64rpx; text-align: center; border-radius: 34rpx; border: 1rpx solid #B2B2B2; margin-left: 20rpx; } .eidt-phone { width: 160rpx; height: 64rpx; line-height: 64rpx; text-align: center; font-weight: 400; font-size: 28rpx; color: #00BC12; border-radius: 34rpx; border: 1rpx solid #00BC12; margin-left: 20rpx; } .eidt-btn { width: 160rpx; height: 64rpx; line-height: 64rpx; text-align: center; font-weight: 400; font-size: 28rpx; color: #FFFFFF; background: #00BC12; border-radius: 34rpx; margin-left: 20rpx; } } } .index-list-item-price { @@ -530,6 +698,9 @@ border: 2rpx solid #FD9E24; } } .hui { color: #999999 !important; } .index-list-item-head-r { font-weight: 400; font-size: 28rpx; @@ -541,35 +712,43 @@ .index-labs { width: 100%; height: 90rpx; padding: 0 30rpx; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; background: #FFFFFF; position: sticky; left: 0; .active { font-weight: 500 !important; font-size: 32rpx !important; color: #222222 !important; } .index-labs-row { flex: 1; .scroll-view_H { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 400; font-size: 30rpx; color: #666666; position: relative; .index-labs-row-x { position: absolute; bottom: 0; left: 50%; width: 40rpx; height: 2rpx; background-color: #00BC12; transform: translate(-50%, 0); white-space: nowrap; .active { font-weight: 500 !important; font-size: 32rpx !important; color: #222222 !important; } .index-labs-row { display: inline-block; height: 100%; line-height: 90rpx; font-weight: 400; font-size: 30rpx; color: #666666; position: relative; margin-right: 62rpx; &:last-child { margin: 0 !important; } .index-labs-row-x { position: absolute; bottom: 0; left: 50%; width: 40rpx; height: 2rpx; background-color: #00BC12; transform: translate(-50%, 0); } } } } small-program/pages/employment-certification/employment-certification.vue
@@ -25,7 +25,7 @@ <input type="text" v-model="form.linkName" placeholder="请输入真实姓名" /> </view> </view> <view class="item" v-if="isCompany"> <view class="item" v-if="isCompany"> <view class="item-label"> <text>单位名称</text> <text>*</text> @@ -44,11 +44,11 @@ </view> </view> <view class="item" @click="chooseMPLoaction"> <view class="item-label" > <view class="item-label"> <text>接单位置</text> <text>*</text> </view> <view class="item-val" > <view class="item-val"> <text>{{form.location || '去选择'}}</text> <u-icon name="arrow-right" color="#111111" size="18"></u-icon> </view> @@ -60,24 +60,27 @@ </view> <view class="item-upload"> <view class="item-upload-item" @click="uploadImg(11)"> <image v-if="form.img11Full && form.img11Full !=''" :src="form.img11Full" mode="widthFix"></image> <image v-else src="/static/image/btn_renxiang@2x.png" mode="widthFix"></image> <image v-if="form.img11Full && form.img11Full !=''" :src="form.img11Full" mode="widthFix"> </image> <image v-else src="/static/image/btn_renxiang@2x.png" mode="widthFix"></image> </view> <view class="item-upload-item" @click="uploadImg(21)"> <image v-if="form.img21Full && form.img21Full !=''" :src="form.img21Full" mode="widthFix"></image> <image v-else src="/static/image/btn_guohui@2x.png" mode="widthFix"></image> <view class="item-upload-item" @click="uploadImg(21)"> <image v-if="form.img21Full && form.img21Full !=''" :src="form.img21Full" mode="widthFix"> </image> <image v-else src="/static/image/btn_guohui@2x.png" mode="widthFix"></image> </view> </view> </view> <view class="item" v-if="isCompany"> <view class="item" v-if="isCompany"> <view class="item-label"> <text>认证资料</text> <text>*</text> </view> <view class="item-upload" v-if="flag==0"> <view class="item-upload-item1" @click="uploadImg(1)"> <view class="item-upload-item1" @click="uploadImg(1)"> <view class="image"> <image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix"></image> <image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -86,9 +89,10 @@ <text>*</text> </view> </view> <view class="item-upload-item1" @click="uploadImg(2)"> <view class="item-upload-item1" @click="uploadImg(2)"> <view class="image"> <image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix"></image> <image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -98,9 +102,10 @@ </view> </view> <view class="item-upload" v-if="flag==1"> <view class="item-upload-item1" @click="uploadImg(1)"> <view class="item-upload-item1" @click="uploadImg(1)"> <view class="image"> <image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix"></image> <image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -109,9 +114,10 @@ <text>*</text> </view> </view> <view class="item-upload-item1" @click="uploadImg(2)"> <view class="item-upload-item1" @click="uploadImg(2)"> <view class="image"> <image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix"></image> <image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -120,9 +126,10 @@ <text>*</text> </view> </view> <view class="item-upload-item1" @click="uploadImg(3)"> <view class="item-upload-item1" @click="uploadImg(3)"> <view class="image"> <image v-if="form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix"></image> <image v-if="form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -132,9 +139,10 @@ </view> </view> <view class="item-upload" v-if="flag==2"> <view class="item-upload-item1" @click="uploadImg(1)"> <view class="item-upload-item1" @click="uploadImg(1)"> <view class="image"> <image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix"></image> <image v-if="form.img1Full && form.img1Full !=''" :src=" form.img1Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -143,9 +151,10 @@ <text>*</text> </view> </view> <view class="item-upload-item1" @click="uploadImg(2)"> <view class="item-upload-item1" @click="uploadImg(2)"> <view class="image"> <image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix"></image> <image v-if="form.img2Full && form.img2Full !=''" :src=" form.img2Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -154,9 +163,10 @@ <text>*</text> </view> </view> <view class="item-upload-item1" @click="uploadImg(3)"> <view class="item-upload-item1" @click="uploadImg(3)"> <view class="image"> <image v-if="form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix"></image> <image v-if="form.img3Full && form.img3Full !=''" :src=" form.img3Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -165,9 +175,10 @@ <text>*</text> </view> </view> <view class="item-upload-item1" @click="uploadImg(4)"> <view class="item-upload-item1" @click="uploadImg(4)"> <view class="image"> <image v-if="form.img4Full && form.img4Full !=''" :src=" form.img4Full" mode="widthFix"></image> <image v-if="form.img4Full && form.img4Full !=''" :src=" form.img4Full" mode="widthFix"> </image> <image v-else src="/static/icon/ic_camera@2x.png" mode="widthFix"></image> <text>点击上传</text> </view> @@ -185,22 +196,29 @@ </template> <script> import { mapState } from 'vuex' import { mapState } from 'vuex' export default { computed: { ...mapState( ['userInfo']) ...mapState(['userInfo']) }, data() { return { bgImg: require('@/static/image/bg_renzheng_yonggong@2x.png'), title: '用户认证', flag: null, <<<<<<< HEAD isCompany: false, loading: false, ======= isCompany:false, loading:false, info: {}, >>>>>>> 66fcf61061d6d275c1848df5d3f8e0082f6b02ba form: { "companyName": "", authType:0, authType: 0, "img1": "", "img2": "", "img11": "", @@ -217,153 +235,193 @@ "lat": null, "lgt": null, "linkName": "", "location": "", "location": "", "telephone": "", "type": 1 "type": 1 } }; }, onLoad(options) { console.log(options) var flag = options.flag this.flag = flag this.flag = flag this.initFormData() <<<<<<< HEAD switch (flag) { ======= this.getApplyData() switch(flag){ >>>>>>> 66fcf61061d6d275c1848df5d3f8e0082f6b02ba case '1': this.title = '货运认证' this.title = '货运认证' this.bgImg = require('@/static/image/bg_renzheng_huoyun@2x.png') break; case '2': this.title = '供餐认证' this.title = '供餐认证' this.bgImg = require('@/static/image/bg_renzheng_gongcan@2x.png') break; default: this.bgImg = require('@/static/image/bg_renzheng_yonggong@2x.png'), this.title = '用工认证' break; this.title = '用工认证' break; } uni.setNavigationBarTitle({ title:this.title title: this.title }) }, methods:{ changeIsCompany(){ this.isCompany =!this.isCompany this.form.authType = this.isCompany?1:0 methods: { changeIsCompany() { this.isCompany = !this.isCompany this.form.authType = this.isCompany ? 1 : 0 }, inNullParam(param){ if(!param){ inNullParam(param) { if (!param) { return true } if(param == ''){ if (param == '') { return true } return false }, applySubmit() { if(this.loading){ if (this.loading) { return } console.log('表单参数:',this.form) this.loading =true if(this.inNullParam(this.form.linkName) ||this.inNullParam(this.form.lat) ||this.inNullParam(this.form.lgt) ||this.inNullParam(this.form.location) ||this.inNullParam(this.form.telephone)){ uni.showToast({title: '对不起,请按要求填写申请信息1!',icon: "none",duration: 2000}); this.loading =false return } if( this.form.authType == 0){ if(this.inNullParam(this.form.img11)||this.inNullParam(this.form.img21)){ uni.showToast({title: '对不起,请按要求填写申请信息3!',icon: "none",duration: 2000}); this.loading =false console.log('表单参数:', this.form) this.loading = true if (this.inNullParam(this.form.linkName) || this.inNullParam(this.form.lat) || this.inNullParam(this.form.lgt) || this.inNullParam(this.form.location) || this.inNullParam(this.form.telephone)) { uni.showToast({ title: '对不起,请按要求填写申请信息1!', icon: "none", duration: 2000 }); this.loading = false return } }else{ if(this.inNullParam(this.form.img1) || this.inNullParam(this.form.companyName)){ uni.showToast({title: '对不起,请按要求填写申请信息4!',icon: "none",duration: 2000}); this.loading =false } if (this.form.authType == 0) { if (this.inNullParam(this.form.img11) || this.inNullParam(this.form.img21)) { uni.showToast({ title: '对不起,请按要求填写申请信息3!', icon: "none", duration: 2000 }); this.loading = false return } } if(this.form.type != 0 && this.form.authType == 1 && this.inNullParam(this.form.img2)){ uni.showToast({title: '对不起,请按要求填写申请信息!',icon: "none",duration: 2000}); this.loading =false } } else { if (this.inNullParam(this.form.img1) || this.inNullParam(this.form.companyName)) { uni.showToast({ title: '对不起,请按要求填写申请信息4!', icon: "none", duration: 2000 }); this.loading = false return } } if (this.form.type != 0 && this.form.authType == 1 && this.inNullParam(this.form.img2)) { uni.showToast({ title: '对不起,请按要求填写申请信息!', icon: "none", duration: 2000 }); this.loading = false return } if(this.form.type == 1 && this.form.authType == 1 && this.inNullParam(this.form.img2)){ uni.showToast({title: '对不起,请按要求填写申请信息5!',icon: "none",duration: 2000}); this.loading =false } if (this.form.type == 1 && this.form.authType == 1 && this.inNullParam(this.form.img2)) { uni.showToast({ title: '对不起,请按要求填写申请信息5!', icon: "none", duration: 2000 }); this.loading = false return } var that = this var param =this.form; if(this.form.authType == 0){ param.img1 = this.form.img11, param.img2 = this.form.img21 } console.log('提交参数:',param) this.$u.api.applyForIdentity(param).then(res =>{ if(res.code ===200){ uni.showToast({ title: res.message||'申请成功 ', icon: "none", duration: 2000 }); uni.navigateBack({ delta: 1 }); } }).finally(()=>{ that.loading =false }) } , chooseMPLoaction(){ var that =this } var that = this var param = this.form; if (this.form.authType == 0) { param.img1 = this.form.img11, param.img2 = this.form.img21 } uni.requestSubscribeMessage({ tmplIds: ['4H9ztG4E9BxJLwMuYSZ6oiM7yb4KX7u7bYhkhYJP0-Y'], success(res) { console.log('提交参数:', param) this.$u.api.applyForIdentity(param).then(res => { if (res.code === 200) { uni.showToast({ title: res.message || '申请成功 ', icon: "none", duration: 2000 }); uni.navigateBack({ delta: 1 }); } }).finally(() => { that.loading = false }) } }) }, chooseMPLoaction() { var that = this uni.chooseLocation({ success:(res)=> { success: (res) => { console.log(res); this.form.location=res.address this.form.lat=res.latitude this.form.lgt=res.longitude this.form.location = res.address this.form.lat = res.latitude this.form.lgt = res.longitude }, fail:()=>{ fail: () => { // 如果用uni.chooseLocation没有获取到地理位置,则需要获取当前的授权信息,判断是否有地理授权信息 uni.getSetting({ success: (res) => { console.log(res); var status = res.authSetting; if(!status['scope.userLocation']){ // 如果授权信息中没有地理位置的授权,则需要弹窗提示用户需要授权地理信息 if (!status['scope.userLocation']) { // 如果授权信息中没有地理位置的授权,则需要弹窗提示用户需要授权地理信息 uni.showModal({ title:"是否授权当前位置", content:"需要获取您的地理位置,请确认授权,否则地图功能将无法使用", success:(tip)=>{ if(tip.confirm){ // 如果用户同意授权地理信息,则打开授权设置页面,判断用户的操作 title: "是否授权当前位置", content: "需要获取您的地理位置,请确认授权,否则地图功能将无法使用", success: (tip) => { if (tip.confirm) { // 如果用户同意授权地理信息,则打开授权设置页面,判断用户的操作 uni.openSetting({ success:(data)=>{ // 如果用户授权了地理信息在,则提示授权成功 if(data.authSetting['scope.userLocation']===true){ success: (data) => { // 如果用户授权了地理信息在,则提示授权成功 if (data .authSetting[ 'scope.userLocation' ] === true ) { uni.showToast({ title:"授权成功", icon:"success", duration:1000 title: "授权成功", icon: "success", duration: 1000 }) // 授权成功后,然后再次chooseLocation获取信息 uni.chooseLocation({ success: (res) => { console.log("详细地址",res); success: ( res ) => { console .log( "详细地址", res ); // this.getRegionFn(res); } }) }else{ } else { uni.showToast({ title:"授权失败", icon:"none", duration:1000 title: "授权失败", icon: "none", duration: 1000 }) } } @@ -375,15 +433,19 @@ }, fail: (res) => { uni.showToast({ title:"调用授权窗口失败", icon:"none", duration:1000 title: "调用授权窗口失败", icon: "none", duration: 1000 }) } }) } }) }, <<<<<<< HEAD uploadImg(index) { var that = this ======= getApplyData(){ var that = this var param ={ type:that.flag} @@ -416,79 +478,80 @@ }, uploadImg(index){ var that =this >>>>>>> 66fcf61061d6d275c1848df5d3f8e0082f6b02ba uni.chooseImage({ count: 1, // 默认9 sizeType: ['original', 'compressed'], sourceType: ['album','camera'],//['album','camera'], mediaType: ['image'],//['image', 'video'], success: function (res1) { const tempFiles = res1.tempFiles //包含图片大小的数组 if (tempFiles[0].size > 20*1024*1024) { uni.showToast({ title: '上传图片不能大于20M!', duration: 2000, icon: "none" }); return } uni.uploadFile({ url: that.$baseUrl + 'web/public/upload', filePath: res1.tempFilePaths[0], name: 'file', formData: { 'folder': 'identity', 'flag':index }, success:(data)=>{ sourceType: ['album', 'camera'], //['album','camera'], mediaType: ['image'], //['image', 'video'], success: function(res1) { const tempFiles = res1.tempFiles //包含图片大小的数组 if (tempFiles[0].size > 20 * 1024 * 1024) { uni.showToast({ title: '上传成功', title: '上传图片不能大于20M!', duration: 2000, icon: "none" }); const res = JSON.parse(data.data) console.log(res) if(res.data.flag == '11'){ that.form.img11=res.data.imgaddr that.form.img11Full=res.data.url }else if(res.data.flag == '21'){ that.form.img21=res.data.imgaddr that.form.img21Full=res.data.url console.log(21,that.form.img21Full) }else if(res.data.flag == '1'){ that.form.img1=res.data.imgaddr that.form.img1Full=res.data.url }else if(res.data.flag == '2'){ that.form.img2=res.data.imgaddr that.form.img2Full=res.data.url }else if(res.data.flag == '3'){ that.form.img3=res.data.imgaddr that.form.img3Full=res.data.url }else if(res.data.flag == '4'){ that.form.img4=res.data.imgaddr that.form.img4Full=res.data.url } }, fail:(e)=>{ uni.showToast({ title: '上传失败', duration: 2000, icon: "none" }); return } }) uni.uploadFile({ url: that.$baseUrl + 'web/public/upload', filePath: res1.tempFilePaths[0], name: 'file', formData: { 'folder': 'identity', 'flag': index }, success: (data) => { uni.showToast({ title: '上传成功', duration: 2000, icon: "none" }); const res = JSON.parse(data.data) console.log(res) if (res.data.flag == '11') { that.form.img11 = res.data.imgaddr that.form.img11Full = res.data.url } else if (res.data.flag == '21') { that.form.img21 = res.data.imgaddr that.form.img21Full = res.data.url console.log(21, that.form.img21Full) } else if (res.data.flag == '1') { that.form.img1 = res.data.imgaddr that.form.img1Full = res.data.url } else if (res.data.flag == '2') { that.form.img2 = res.data.imgaddr that.form.img2Full = res.data.url } else if (res.data.flag == '3') { that.form.img3 = res.data.imgaddr that.form.img3Full = res.data.url } else if (res.data.flag == '4') { that.form.img4 = res.data.imgaddr that.form.img4Full = res.data.url } }, fail: (e) => { uni.showToast({ title: '上传失败', duration: 2000, icon: "none" }); } }) }, fail:function(err){ hideLoading() reject("选择文件失败",err) fail: function(err) { hideLoading() reject("选择文件失败", err) } }) }, initFormData(){ initFormData() { this.form = { "companyName": "", authType:0, authType: 0, "img1": "", "img2": "", "img11": "", @@ -505,8 +568,8 @@ "lat": null, "lgt": null, "linkName": this.userInfo.name, "location": "", "telephone": this.userInfo.telephone, "location": "", "telephone": this.userInfo.telephone, "type": this.flag } } @@ -523,6 +586,7 @@ <style lang="scss" scoped> .box { width: 100%; .box-head { width: 100%; height: 300rpx; @@ -530,6 +594,7 @@ box-sizing: border-box; background-repeat: no-repeat; background-size: 100% 100%; .box-head-botton { width: 100%; height: 88rpx; @@ -542,24 +607,28 @@ border-radius: 44rpx; margin-top: 30rpx; } .box-head-info { width: 100%; display: flex; flex-direction: column; text { &:nth-child(1) { font-weight: bold; font-size: 48rpx; color: #FFFFFF; } &:nth-child(2) { font-weight: 400; font-size: 26rpx; color: rgba(255,255,255,0.8); color: rgba(255, 255, 255, 0.8); margin-top: 14rpx; } } } .box-head-content { width: 100%; padding: 40rpx 30rpx; @@ -567,14 +636,17 @@ background-color: #FFFFFF; border-radius: 20rpx; margin-top: 30rpx; .item { width: 100%; display: flex; flex-direction: column; margin-bottom: 30rpx; &:last-child { margin: 0 !important; } .item-cate { width: 100%; display: flex; @@ -582,10 +654,12 @@ padding: 30rpx 0; box-sizing: border-box; border-bottom: 1rpx solid #E5E5E5; .active { background: #00BC12 !important; color: #FFFFFF !important; } .item-cate-row { width: 208rpx; height: 72rpx; @@ -594,20 +668,24 @@ background: #EEEEEE; border-radius: 36rpx; margin-right: 20rpx; &:last-child { margin: 0 !important; } } } .item-label { display: flex; align-items: center; text { &:nth-child(1) { font-weight: 500; font-size: 32rpx; color: #222222; } &:nth-child(2) { font-weight: 500; font-size: 32rpx; @@ -615,6 +693,7 @@ } } } .item-upload { width: 100%; padding: 30rpx 0; @@ -623,6 +702,7 @@ align-items: center; justify-content: space-between; flex-wrap: wrap; .item-upload-item { width: 300rpx; border-radius: 10px; @@ -631,30 +711,35 @@ align-items: center; justify-content: content; overflow: hidden; border:1px solid #c2c2c2; border: 1px solid #c2c2c2; image { width: 100%; height: 100%; } } .item-upload-item1 { width: 45%; padding-bottom: 40px; border-radius: 10px; .image { width: 100%; height: 196rpx; background: #F7F7F7; border:1px solid #c2c2c2; border: 1px solid #c2c2c2; border-radius: 16rpx; display: flex; align-items: center; justify-content: center; flex-direction: column; image { width: 48rpx; height: 48rpx; } text { font-weight: 400; font-size: 28rpx; @@ -662,18 +747,21 @@ margin-top: 12rpx; } } .info { width: 100%; display: flex; align-items: center; justify-content: center; margin-top: 16rpx; text { &:nth-child(1) { font-weight: 400; font-size: 26rpx; color: #333333; } &:nth-child(2) { font-weight: 400; font-size: 26rpx; @@ -683,6 +771,7 @@ } } } .item-val { width: 100%; padding: 30rpx 0; @@ -692,17 +781,20 @@ align-items: center; justify-content: space-between; border-bottom: 1rpx solid #E5E5E5; input { width: 100%; font-weight: 400; font-size: 30rpx; color: #222222; } text { font-weight: 400; font-size: 30rpx; color: #666666; } button { width: 100%; height: 100%; @@ -716,4 +808,4 @@ } } } </style> </style> small-program/pages/index/index.vue
@@ -11,14 +11,12 @@ <view class="search" :style="{ top: statusbarHeight + navHeight + 'px' }"> <view class="index-j-cate"> <view class="index-j-cate-item" v-for="(item, index) in searchType" :key="index" @click="clickCate(item.id)"> <text :style="{ color: typeVal === item.id ? '##222222' : '' }">{{item.name}}</text> <text :style="{ color: typeVal === item.id ? '#222222' : '', fontSize: typeVal === item.id ? '36rpx' : '', fontWeight: typeVal === item.id ? '600' : '' }">{{item.name}}</text> <view class="index-j-cate-item-x" v-if="typeVal === item.id"></view> </view> </view> <view class="index-j-search"> <view class="index-j-search-item active">最新发布</view> <view class="index-j-search-item">距离优先</view> <view class="index-j-search-item">价格从高到低</view> <view :class="sortType === item.id ? 'index-j-search-item active' : 'index-j-search-item'" v-for="(item, index) in sortList" :key="index" @click="clickSort(item.id)">{{item.name}}</view> </view> </view> <view class="index-j-list"> @@ -40,31 +38,43 @@ {{item.categoryName}}|{{item.priceNum1}}斤 </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 1"> {{item.categoryName}}|{{item.priceNum1}}斤 {{item.categoryName}}|{{item.priceNum1}}人 </view> <view class="index-list-item-info" v-if="item.type === 0 && item.workType === 2"> {{item.categoryName}}|{{item.priceNum1}}斤 {{item.categoryName}}|{{item.priceNum1}}人 </view> <view class="index-list-item-info" v-if="item.type === 1"> {{item.categoryName}}|{{item.priceNum1}}斤 {{item.transportTypeName}} | {{item.transportNum}}{{item.transportUnit}}|用车{{item.priceNum1}}天 </view> <view class="index-list-item-info" v-if="item.type === 2"> {{item.wayInfoCopy}} </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>{{item.location}}</text> <view class="address" v-if="item.type === 1"> <view class="address-xian"></view> <view class="address-row" v-for="(address, i) in item.wayInfo" :key="i"> <image src="/static/icon/ic_qidian@2x.png" mode="widthFix" v-if="i === 0"></image> <image src="/static/icon/ic_jingguo@2x.png" mode="widthFix" v-else-if="i !== 0 && i !== item.wayInfo.length - 1"></image> <image src="/static/icon/ic_zhongdian@2x.png" mode="widthFix" v-else-if="i === item.wayInfo.length - 1"></image> <text>{{item.location}}</text> </view> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>{{item.startDate}} 至 {{item.endDate}}({{item.priceNum1}}天)</text> </view> <template v-if="[0, 2].includes(item.type)"> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_location@2x.png" mode="widthFix"></image> <text>{{item.location}}</text> </view> <view class="index-list-item-dz"> <image src="/static/icon/order_ic_time@2x.png" mode="widthFix"></image> <text>{{item.startDate}} 至 {{item.endDate}}({{item.priceNum1}}天)</text> </view> </template> <view class="index-list-item-price"> <text>预估:</text> <text>¥{{item.estimatedAccount / 100}}</text> </view> <view class="eidt"> <sunui-mverify @change="mverify($event, item.id)"></sunui-mverify> <sunui-mverify @change="getaccept($event, item.id, index)"></sunui-mverify> </view> </view> </view> @@ -311,7 +321,7 @@ export default { components: { sunuiMverify }, computed: { ...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid']), ...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid', 'latitude', 'longitude']), totalPrice() { return this.form.estimatedAccount / 100 } @@ -346,6 +356,11 @@ { name: '分拣工', id: 1 }, { name: '包装工', id: 2 } ], sortList: [ { name: '最新发布', id: 0 }, { name: '距离优先', id: 1 }, { name: '价格从高到低', id: 2 } ], car: [], btn: require('@/static/image/btn.png'), typeViewId: 0, @@ -375,13 +390,15 @@ estimatedAccount: '', price: '' }, sortType: 0, orderList: [], typeVal: '', page: 1 page: 1, next: true } }, onLoad() { async onLoad() { await this.$onLaunched; this.getCategoryLists() this.getOrderList() this.form.linkPhone = this.userInfo.telephone @@ -389,29 +406,23 @@ watch: { typeId: { handler(news, old) { this.form = { startDate: '', endDate: '', latitude: '', longitude: '', location: '', locationEnd: '', wayInfoDTOList: [], workType: 0, categoryId: '', categoryName: '', days: '', locationRemark: '', supplement: '', multifileList: [], linkName: '', linkPhone: '', estimatedAccount: '', price: '' } this.form.startDate = '' this.form.endDate = '' this.form.latitude = '' this.form.longitude = '' this.form.location = '' this.form.locationEnd = '' this.form.wayInfoDTOList = '' this.form.workType = '' this.form.days = '' this.form.locationRemark = '' this.form.supplement = '' this.form.multifileList = [] this.form.linkName = '' this.form.estimatedAccount = '' this.form.price = '' this.viewStatus = false this.carImage = '' this.carRemark = '' } }, orderFood: { @@ -440,21 +451,49 @@ } } }, onReachBottom() { this.getOrderList() }, methods: { // 手动接单 getaccept(e, orderId, index) { this.$u.api.accept({ orderId }) .then(res => { uni.showToast({ title: '抢单成功!', icon: 'success', duration: 2000 }) setTimeout(() => { this.page = 1 this.next = true this.orderList = [] this.getOrderList() }, 2000) }) }, clickSort(id) { this.sortType = id this.page = 1 this.next = true this.orderList = [] this.getOrderList() }, clickCate(id) { this.typeVal = id this.page = 1 this.list = [] this.next = true this.orderList = [] this.getOrderList() }, // 订单分页 getOrderList() { if (!this.next) return; this.$u.api.orderPage({ capacity: 10, page: this.page, model: { queryMyOrderType: 2, type: this.typeVal type: this.typeVal, sortType: this.sortType, queryLat: this.latitude, queryLgt: this.longitude } }).then(res => { res.data.records.forEach(item => { @@ -463,10 +502,16 @@ item.wayInfoCopy = JSON.parse(item.wayInfo).map(item => { return `${item.name}${item.price / 100}元(${item.num}份)` }).join(' | ') // 运货 } else if (item.type === 1) { item.wayInfo = JSON.parse(item.wayInfo) } }) console.log(res.data.records) this.orderList = [...this.orderList, ...res.data.records] if (this.orderList.length === res.data.total) { this.next = false } }) }, // 提交订单 @@ -604,6 +649,12 @@ }, clickType(e) { this.typeId = e if (e === 2) { this.form.categoryId = this.car[0].id this.form.categoryName = this.car[0].name this.carRemark = this.car[0].remark this.carImage = this.car[0].iconFull } }, clickTypeWork(e) { this.form.workType = e @@ -681,9 +732,6 @@ url: `/pages/freight/freight` }) } }, mverify(e, id){ console.log('验证结果:', e, id); }, // 选择套餐 selectMenu(a, b) { small-program/pages/mine/mine.vue
@@ -260,6 +260,7 @@ console.log(222,res) if(res.code ===200){ that.userInfo.useIdentity = param.useIdentity uni.$emit('refresh') } }).finally(() => { that.changing1 = false small-program/store/index.js
@@ -16,7 +16,10 @@ statusbarHeight: statusbarHeight || '', userInfo: userInfo || {}, token: token || '', openid:token || '' openid: token || '', latitude: '', longitude: '' }, mutations: { // 设置导航栏高度 @@ -41,6 +44,12 @@ state.userInfo = val uni.setStorageSync('userInfo', val); }, // 设置经纬度 setPosition(state, obj) { console.log(obj) state.latitude = obj.latitude state.longitude = obj.longitude }, // 清除缓存数据 empty(state) { state.userInfo = '' small-program/utils/http.interceptor.js
@@ -13,7 +13,7 @@ // 响应拦截器 uni.$u.http.interceptors.response.use((response) => { console.log(response.data) // console.log(response.data) if (response.data.code === 5113) { uni.switchTab({ url: '/pages/index/index'