liudan 1 year ago
parent 59a31f436e
commit 849d7d6904
  1. 30
      App.vue
  2. 8
      api/modules/service.js
  3. 1
      components/min-countdown.vue
  4. 7
      manifest.json
  5. 131
      pages/login.vue
  6. 22
      pages/mine.vue
  7. 49
      pages/service.vue
  8. 18
      pages/technician.vue
  9. 8
      store/modules/config.js
  10. 97
      store/modules/user.js
  11. 8
      technician/pages/order/detail.vue
  12. 7
      technician/pages/order/list.vue
  13. 17
      technician/pages/time-manage.vue
  14. 1
      user/pages/distribution/team.vue
  15. 11
      user/pages/order.vue
  16. 1
      user/pages/order/detail.vue
  17. 3
      user/pages/setting.vue
  18. 47
      user/pages/traffic/index.vue

@ -1,3 +1,4 @@
<script>
import $api from "@/api/index.js"
import $store from "@/store/index.js"
@ -58,19 +59,43 @@
let {
primaryColor = ''
} = $store.state.config.configInfo
if (primaryColor) return
await this.getBaseConfig()
},
async onShow() {
console.log('App Show')
console.log('App Show');
// this.timer = setInterval(()=>{
// // this.onlineStatus()
// console.log("666",uni.getStorageSync('configInfo'))
// },1000)
// this.$store.user.dispatch.
// this.userInfo = uni.getStorageSync('userInfo');
console.log("666",this.$store.state.user.userInfo)
},
// watch:{
// '$store.state.user.userInfo':{
// deep:true,
// immediate:true,
// handler:function(newV){
// console.log("==32323==",newV)
// // this.timer = setInterval(()=>{
// // // this.onlineStatus()
// // console.log("666",newV)
// // },1000)
// }
// }
// },
onHide() {
console.log('App Hide')
clearInterval(this.timer);
this.timer = null;
},
methods: {
async getBaseConfig() {
let config = await $api.base.getConfig()
let config = await $api.base.getConfig();
console.log(config,"zazaza")
if (!config.primaryColor) {
config.primaryColor = '#A40035'
}
@ -84,7 +109,6 @@
})
},
async onlineStatus(){
console.log("uuuu")
let res = await this.$api.mine.onlineStatus()
console.log(res,"pppp")
}

@ -18,6 +18,14 @@ export default {
serviceCoachList(param) {
return req.get("/massage/app/Index/serviceCoachList", param)
},
//获取技师
getSeviceInfo(param) {
return req.get("/massage/app/Index/getLocation", param)
},
//更新位置
updatePosition(param) {
return req.get("/massage/app/Index/updateLocation", param)
},
// 技师服务列表(coach_id)
coachServiceList(param) {
return req.get("/massage/app/Index/coachServiceList", param)

@ -112,6 +112,7 @@
this.audioBg = uni.createInnerAudioContext();
this.audioBg.src = countdown_voice
this.audioBg.obeyMuteSwitch = false
console.log("22",this.audioBg)
this.updateUserItem({
key: 'isHaveAudio',
val: true

@ -3,8 +3,8 @@
"appid" : "__UNI__3303922",
// "appid" : "__UNI__AE4A250",
"description" : "希希到家",
"versionName" : "10.0.0",
"versionCode" : 1000,
"versionName" : "10.0.1",
"versionCode" : 1001,
"transformPx" : false,
"uniStatistics" : {
"enable" : false //
@ -141,7 +141,8 @@
"UniversalLinks" : "https://xixi-api.njrenzhou.cn/"
}
},
"ad" : {}
"ad" : {},
"push" : {}
},
"android" : {
"permissions" : [

@ -60,12 +60,15 @@
</view>
<u-button text="登录" :disabled="!phone||!code" @click="smsLogin" class="loginBtn"></u-button>
<!-- <view >登录</view> -->
<!-- <view class="otherLogin">
<!-- #ifdef APP-PLUS -->
<view class="otherLogin">
<view class="line"></view>
<view class="otext">其他登录</view>
<view class="line"></view>
</view>
<image src="@/static/wlogin.png" class="wlogin" @tap="$refs.show_rule_item.open()" mode="widthFix"></image> -->
<image src="@/static/wlogin.png" class="wlogin" @tap="$refs.show_rule_item.open()" mode="widthFix"></image>
<!-- <view class="page-height flex-center flex-column">
<image mode="aspectFill" lazy-load class="logo-img mb-md" :src="base_info.app_logo"></image>
<view class="f-caption c-caption">{{base_info.app_text}}</view>
@ -75,7 +78,7 @@
</view>
</view> -->
<!-- <uni-popup ref="show_rule_item" type="center" :maskClick="false">
<uni-popup ref="show_rule_item" type="center" :maskClick="false">
<view class="common-popup-content fill-base pd-lg radius-34">
<view class="title">温馨提示</view>
<view class="f-desc c-title mt-lg">
@ -91,7 +94,8 @@
:style="{background: primaryColor,color:'#fff'}">确定</view>
</view>
</view>
</uni-popup> -->
</uni-popup>
<!-- #endif -->
</view>
</template>
@ -113,12 +117,19 @@
code:'',
phone:'',
checked:[],
pid:null
}
},
async onLoad() {
console.log('pages/login',"888")
async onLoad(option) {
// console.log('pages/login',"888")
// #ifdef H5
var searchURL = window.location.search;
searchURL = searchURL.substring(1, searchURL.length);
var targetPageId = searchURL.split("&")[0].split("=")[1];
// console.log(option,targetPageId.substring(-1,1))
this.pid=targetPageId?targetPageId.substring(-1,1):''
// #endif
let {
autograph = '',
appLogin = ''
@ -163,61 +174,61 @@
userInfo: state => state.user.userInfo,
}),
methods: {
...mapActions(['getConfigInfo', 'getUserInfo']),
...mapActions(['getConfigInfo', 'getUserInfo','getMineInfo']),
...mapMutations(['updateConfigItem', 'updateUserItem']),
//
// async wxLogin() {
// this.$refs.show_rule_item.close()
// try {
// let [providerErr, providerData] = await uni.getProvider({
// service: 'oauth',
// });
// console.log("111")
// // let [loginErr, loginData] =await uni.getUserProfile({
// // desc: '',
// // lang: 'zh_CN',
// // success: res => {
// // console.log(res,"jjj");
// // // this.isShowLogin = false;
// // // this.userInfo = res.userInfo;
// // },
// // fail: err => {
// // console.log(err.errMsg);
// // }
// // });
async wxLogin() {
this.$refs.show_rule_item.close()
try {
let [providerErr, providerData] = await uni.getProvider({
service: 'oauth',
});
console.log("111")
// let [loginErr, loginData] =await uni.getUserProfile({
// desc: '',
// lang: 'zh_CN',
// success: res => {
// console.log(res,"jjj");
// // this.isShowLogin = false;
// // this.userInfo = res.userInfo;
// },
// fail: err => {
// console.log(err.errMsg);
// }
// });
// let [loginErr, loginData] = await uni.login({
// provider: 'weixin'
// });
// console.log("222")
// let [infoErr, infoData] = await uni.getUserInfo({
// provider: 'weixin'
// })
// console.log("333",infoData)
// let {
// userInfo = {}
// } = infoData
// let {
// openId = ''
// } = userInfo
// if (!openId) return
// this.$util.showLoading({
// title: "..."
// })
// try {
// this.toLogin(userInfo)
// } catch (e) {
// this.$util.hideAll()
// }
// } catch (e) {
// console.log(e)
// this.$util.showToast({
// title: ''
let [loginErr, loginData] = await uni.login({
provider: 'weixin'
});
console.log("222")
let [infoErr, infoData] = await uni.getUserInfo({
provider: 'weixin'
})
console.log("333",infoData)
let {
userInfo = {}
} = infoData
let {
openId = ''
} = userInfo
if (!openId) return
this.$util.showLoading({
title: "登录中..."
})
try {
this.toLogin(userInfo)
} catch (e) {
this.$util.hideAll()
}
} catch (e) {
console.log(e)
this.$util.showToast({
title: '请先安装微信或升级版本'
// });
// }
});
}
// },
},
async smsLogin(item){
console.log("短信登陆")
if(this.checked.length==0){
@ -228,7 +239,8 @@
if(!item){
userInfo = await this.$api.base.smsLogin({
phone:this.phone,
code:this.code
code:this.code,
pid:this.pid
})
}else{
userInfo = item;
@ -261,6 +273,7 @@
if (!this.configInfo.id) {
await this.getConfigInfo()
}
this.getMineInfo(1)
let {
phone = ''
} = data
@ -274,7 +287,7 @@
}
},
async toLogin(userInfo) {
console.log(userInfo,"mmnn")
console.log(userInfo,"mmnn",this.configInfo)
let user_info = await this.$api.base.appLogin({
data: userInfo
})

@ -57,7 +57,7 @@
<view class="mt-md" style="height: 72rpx" v-else></view> -->
</view>
</view>
<auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true" v-if="userPageType == 1"
<auth :needAuth="userInfo && (!userInfo.phone || !userInfo.nickName)" :must="true" v-if="userPageType == 1&&userInfo.switch==1"
:type="!userInfo.phone ? 'phone' : 'userInfo'" @go="$util.goUrl({ url: `/user/pages/stored/list` })"
>
<!-- <view
@ -656,7 +656,23 @@
},
async getCoachInfo() {
this.coach_info = await this.$api.technician.coachInfo()
console.log(this.coach_info,"88888")
let location = await this.$util.getBmapLocation()
console.log(location,"locai")
let res = await this.$api.service.updatePosition({
c_id:this.coach_info.user_id,location:location.address
}).catch(err=>{
console.log(err)
})
console.log(this.coach_info.user_id,location.address)
let address = await this.$api.service.getSeviceInfo({
c_id:this.coach_info.user_id
})
console.log(address,"mmmm")
this.coach_info.address = address.location;
},
//
async authUserProfile(e) {
// #ifdef APP-PLUS
@ -761,14 +777,14 @@
}
if (text == '联系客服') {
let {
mobile: url,
mobile: mobile,
im_type
} = this.configInfo
// #ifdef MP-WEIXIN
if (im_type == 2) return
// #endif
this.$util.goUrl({
url,
url:mobile,
openType: 'call'
})

@ -21,7 +21,7 @@
</view>
<!-- :style="{height:banner.length > 0?`464rpx`:`84rpx`}" -->
<view :class="[{'rel':banner.length >0}]">
<banner :list="banner" :height="580" :margin="0" :autoplay="false" :indicatorActiveColor="primaryColor" :dotWidth="20"
<banner :list="banner" :height="580" :margin="0" :autoplay="true" :indicatorActiveColor="primaryColor" :dotWidth="20"
:dotBottom="30" v-if="banner.length > 0">
</banner>
<view class="tab">
@ -50,10 +50,15 @@
:duration="1000" previous-margin="108px" next-margin="108px">
<swiper-item class="recommendItem" v-for="(item, index) in picList" :key="index">
<image :src="item.work_img"></image>
<view class="flag new" v-if="item.coach_type_status==3">新人</view>
<view class="flag people" v-if="item.coach_type_status==2">推荐</view>
<view class="flag people" v-if="item.coach_type_status==1">销冠</view>
<view style="margin:0 8rpx;position:relative;border-radius: 27rpx;overflow: hidden;">
<image :src="item.work_img" mode="aspectFill"></image>
<view class="flag new" v-if="item.coach_type_status==3">新人</view>
<view class="flag people" v-if="item.coach_type_status==2">推荐</view>
<view class="flag people" v-if="item.coach_type_status==1">销冠</view>
<view class="nameText">
{{item.coach_name}}
</view>
</view>
</swiper-item>
<!-- <swiper-item>
<view class="swiper-item uni-bg-green">B</view>
@ -293,10 +298,10 @@
async initIndex(refresh = false) {
// #ifdef H5
if (!refresh && this.$jweixin.isWechat()) {
await this.$jweixin.initJssdk();
this.toAppShare()
}
// if (!refresh && this.$jweixin.isWechat()) {
// await this.$jweixin.initJssdk();
// this.toAppShare()
// }
// #endif
if (!this.configInfo.id || refresh) {
await this.getConfigInfo()
@ -327,7 +332,7 @@
},
getItemHandle(item){
console.log(item,this.configInfo)
console.log("点击项",this.configInfo)
if(item.name=="领券中心"){
this.$util.goUrl({
url: '/user/pages/coupon/list'
@ -335,14 +340,14 @@
}
if(item.name=="联系客服"){
let {
mobile: url,
mobile: mobile,
im_type
} = this.configInfo
// #ifdef MP-WEIXIN
if (im_type == 2) return
// #endif
this.$util.goUrl({
url:'15189150006',
url:mobile,
openType: 'call'
})
}
@ -590,15 +595,27 @@
// width:240rpx;
// height:300rpx;
// background: #aaaaaa;
border-radius: 27rpx;
// border-radius: 27rpx;
// overflow: hidden;
margin-right:24rpx;
position: relative;
// margin-right:24rpx;
// position: relative;
image{
width:240rpx;
// width:240rpx;
width:100%;
height:300rpx;
border-radius: 27rpx;
}
.nameText{
position: absolute;
height:50rpx;
bottom:0rpx;
line-height:50rpx;
background-color: rgba(0, 0, 0, 0.5);
color:#ffffff;
z-index:99;
width:100%;
text-align: center;
}
.flag{
width: 100rpx;
height: 50rpx;line-height: 50rpx;text-align: center;

@ -53,7 +53,7 @@
<!-- <view class="top-tag flex-center f-icontext abs" v-if="item.coach_type_status==1"></view> -->
<view class="flex-center flex-column">
<view class="item-img rel">
<image @tap.stop="toPreviewImage(index,1)" mode="" lazy-load class="item-img"
<image @tap.stop="toPreviewImage(index,1)" mode="aspectFill" lazy-load class="item-img"
:src="item.work_img">
</image>
<!-- <image @tap.stop="item.coach_type_status==1?toPreviewImage(index,1):''" lazy-load class="abs"
@ -118,7 +118,7 @@
</view>
</view>
<view @tap.stop="toShowPopup(index,'technician')" class="item-btn flex-center f-desc c-base"
<view @tap.stop="toShowPopup(index,'technician')" class="item-btn flex-center f-desc c-base" v-if="item.near_time"
:style="{background:item.user_id?primaryColor:'#888'}">预约
</view>
</view>
@ -260,6 +260,7 @@
mapMutations
} from "vuex"
import tabbar from "@/components/tabbar.vue"
import { onLoad } from "../uni_modules/uview-ui/libs/mixin/mixin"
export default {
components: {
tabbar
@ -300,6 +301,7 @@
carList: state => state.order.carList,
}),
async onLoad() {
console.log("999")
// #ifdef H5
uni.setNavigationBarTitle({
title: '技师'
@ -308,13 +310,14 @@
// #ifndef H5
this.$util.showLoading()
// #endif
await this.initIndex(true)
if (this.pageActive) {
this.isLoad = true
this.loading = false
this.$util.hideAll()
return
}
await this.initIndex()
this.updateTechnicianItem({
key: 'pageActive',
val: true
@ -348,11 +351,12 @@
...mapActions(['getConfigInfo', 'getUserInfo', 'getCarList', 'getCityList', 'getServiceCoachList']),
...mapMutations(['updateUserItem', 'updateTechnicianItem']),
async initIndex(refresh = false) {
console.log("777")
// #ifdef H5
// if (!refresh && this.$jweixin.isWechat()) {
// await this.$jweixin.initJssdk();
// this.toAppShare()
// }
if (!refresh && this.$jweixin.isWechat()) {
await this.$jweixin.initJssdk();
this.toAppShare()
}
// #endif
if (!this.configInfo.id || refresh) {
await this.getConfigInfo()

@ -104,6 +104,7 @@ export default {
config.coach_font_color = '#ffffff'
}
let data = Object.assign(state.configInfo, config)
console.log(data,"1234567890")
commit('updateConfigItem', {
key: 'configInfo',
val: data
@ -113,10 +114,13 @@ export default {
commit,
state
}, param) {
if (state.playBg) {
console.log("播放")
if (state.playBg||param) {
state.audioBg.stop()
}else{
state.audioBg.play()
}
state.audioBg.play()
}
}
}

@ -17,11 +17,16 @@ export default {
wxlocation: {},
isShowAuth: true,
mineInfo: {},
userPageType: 1 // 1用户,2技师
isFinished:null,//1为登录,2为不登陆
userPageType: 1, // 1用户,2技师
audioBg: {},
playBg: false,
isHaveAudio: false
},
mutations: {
//更新内容
async updateUserItem(state, item) {
let {
key,
val
@ -40,6 +45,10 @@ export default {
if (['autograph', 'userInfo', 'location', 'appLogin'].includes(key)) {
uni.setStorageSync(key, val)
}
},
setUnfinished(state,item){
console.log(item,"item")
state.isFinished = item
}
},
actions: {
@ -58,6 +67,7 @@ export default {
//获取用户个人中心数据
async getMineInfo({
commit,
dispatch,
state
}, param) {
let data = await $api.mine.index()
@ -70,7 +80,90 @@ export default {
key: 'mineInfo',
val: data
})
let timer;
let newList;
if(param==1){
if(data.coach_status==2){
newList = await $api.technician.orderList({
page: 1,pay_type: 2
})
if(newList.total!=0){
// dispatch('toPlayAudio1',1)
}
// timer = setInterval(async()=>{
// newList = await $api.technician.orderList({
// page: 1,pay_type: 2
// })
// if(newList.total!=0){
// dispatch('toPlayAudio1',1)
// }
// },300000)
// commit('setUnfinished', {haveUnfinished:haveUnfinished});
}
}else{
clearInterval(timer);
// state.audioBg = uni.createInnerAudioContext();
// state.audioBg.src=null;
// state.audioBg?state.audioBg.stop():null;
}
},
stopMusic({state}){
state.audioBg = uni.createInnerAudioContext();
state.audioBg.src=null;
// state.audioBg?state.audioBg.stop():null;
state.audioBg.stop()
},
// async toPlayAudio1({
// commit,
// state
// }, param) {
// console.log("播放",state.playBg)
// let val = await $api.base.configInfo()
// state.audioBg = uni.createInnerAudioContext();
// state.isHaveAudio = true
// let {
// countdown_voice
// } = val
// state.audioBg.src = countdown_voice
// state.playBg = true;
// // #ifndef APP-PLUS
// state.audioBg.obeyMuteSwitch = false
// // #endif
// let play_method = [{
// method: 'onPlay',
// msg: '开始播放',
// status: true,
// }, {
// method: 'onStop',
// msg: '结束播放',
// status: false,
// }, {
// method: 'onError',
// msg: '报错Error',
// status: false,
// }, {
// method: 'onEnded',
// msg: '自然结束播放',
// status: false,
// }];
// play_method.map(item => {
// state.audioBg[item.method](() => {
// console.log('bg=>', item.msg)
// state.playBg = item.status;
// })
// })
// if (!state.playBg||param==2) {
// console.log("999")
// state.audioBg.pause()
// }else{
// state.audioBg.play()
// }
// // state.audioBg.play()
// },
// 获取用户信息
async getAuthUserProfile({
commit,
@ -142,6 +235,6 @@ export default {
})
console.log(target, "======target");
return target
}
},
}
}

@ -152,7 +152,7 @@
<!-- 服务中 -->
<block v-if="detail.pay_type == 6">
<button @tap.stop="toConfirm(7)" class="clear-btn order"
:style="{color:'#fff',background:primaryColor,borderColor:primaryColor}">拍照完成服务</button>
:style="{color:'#fff',background:primaryColor,borderColor:primaryColor}">完成服务</button>
</block>
</view>
</view>
@ -264,9 +264,13 @@
onLoad(options) {
this.options = options
this.initIndex()
// this.toPlayAudio1(2)
},
onUnload(){
this.toPlayAudio(true)
},
methods: {
...mapActions(['getConfigInfo']),
...mapActions(['getConfigInfo','toPlayAudio']),
...mapMutations(['']),
async initIndex(refresh = false) {
// #ifdef H5

@ -59,7 +59,7 @@
<!-- 服务中 -->
<block v-if="item.pay_type == 6">
<button @tap.stop="toConfirm(index,7)" class="clear-btn order"
:style="{color:'#fff',background:primaryColor,borderColor:primaryColor}">拍照完成服务</button>
:style="{color:'#fff',background:primaryColor,borderColor:primaryColor}">完成服务</button>
</block>
</view>
</view>
@ -156,6 +156,7 @@
} = options
this.activeIndex = tab
this.initIndex()
this.getMineInfo(2)
},
onPullDownRefresh() {
// #ifndef APP-PLUS
@ -171,7 +172,7 @@
this.getList();
},
methods: {
...mapActions(['getConfigInfo']),
...mapActions(['getConfigInfo','getMineInfo']),
...mapMutations(['']),
async initIndex(refresh = false) {
// #ifdef H5
@ -255,7 +256,7 @@
if (type == -1) {
param.coach_refund_text = this.coach_refund_text
}
if (type == 5 || type == 7) {
if (type == 5) {
let [res_upload, {
tempFiles = [],
tempFilePath = ''

@ -137,15 +137,16 @@
return
}
// let start_time = `${this.toDay} ${param.start_time}`
// let end_time = `${this.toDay} ${param.end_time}`
// if (this.$util.DateToUnix(start_time) > this.$util.DateToUnix(end_time) - 1) {
// this.$util.showToast({
// title: ``
// })
// return
// }
let start_time = `${this.toDay} ${param.start_time}`
let end_time = `${this.toDay} ${param.end_time}`
if (this.$util.DateToUnix(start_time) > this.$util.DateToUnix(end_time) - 1) {
this.$util.showToast({
title: `结束时间不能小于或等于开始时间`
})
return
}
delete param.coach_status
console.log(param)
this.$util.showLoading()
await this.$api.technician.coachUpdate(param)
this.$util.hideAll()

@ -86,6 +86,7 @@
param,
} = this
let newList = await this.$api.mine.myTeam(param);
console.log(param)
if (this.param.page == 1) {
this.list = newList
} else {

@ -245,10 +245,10 @@
data() {
return {
carTypeList: [
// {
// id: 1,
// title: ''
// },
{
id: 1,
title: '出租车'
},
{
id: 0,
title: '公交/地铁'
@ -326,6 +326,7 @@
})
}
// #endif
console.log(this.configInfo,"999")
if (!this.configInfo.id || refresh) {
await this.getConfigInfo()
}
@ -525,6 +526,7 @@
let {
pay_list
} = await this.$api.order.payOrder(param)
this.$util.hideAll()
if (pay_list) {
try {
@ -564,6 +566,7 @@
})
}, 1000)
} catch (e) {
console.log(e,"iiii")
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()

@ -297,6 +297,7 @@
onLoad(options) {
this.options = options
this.initIndex()
console.log(this.configInfo,"=====")
},
methods: {
...mapActions(['getConfigInfo']),

@ -106,7 +106,7 @@
this.initIndex()
},
methods: {
...mapActions(['getUserInfo']),
...mapActions(['getUserInfo','getMineInfo']),
...mapMutations(['updateUserItem']),
zhuxiao(){
let that = this;
@ -154,6 +154,7 @@
},
toLoginOut() {
this.getMineInfo(0)
let arr = ['autograph', 'userInfo', 'location', 'appLogin']
arr.map(key => {
uni.setStorageSync(key, '')

@ -21,7 +21,7 @@
<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
</view>
</view>
<view class="btn" @click="trafficList">
<view class="btn" @click="trafficList(false)">
保存
</view>
<u-action-sheet :actions="list"
@ -96,14 +96,45 @@ export default{
this.show = true;
this.handleName=val
},
async trafficList(){
let res= await this.$api.mine.trafficList({
day_car:this.form.day_car,
night_car:this.form.night_car,
max_distance:this.form.max_distance
})
console.log(res,"nnn")
async trafficList(val){
console.log(val,"000")
let params
if(val){
params={
getTime :1
}
}else{
params={
day_car:this.form.day_car,
night_car:this.form.night_car,
max_distance:this.form.max_distance
}
}
let res= await this.$api.mine.trafficList(params)
console.log(res)
if(val){
let arr1 = this.list.filter(item=>{
return item.value == res.day_car
})
let arr2 = this.list.filter(item=>{
return item.value == res.night_car
})
this.form.max_distance = res.max_distance
this.form.day_car = res.day_car
this.form.day_car_name = arr1[0].name
this.form.night_car = res.night_car
this.form.night_car_name = arr2[0].name
}else{
uni.showToast({
title: '保存成功'
});
}
}
},
onLoad(){
this.trafficList(true)
}
}
</script>

Loading…
Cancel
Save