Commit 36860090 authored by Damon's avatar Damon
parents 11a92117 9ebfd832
...@@ -5,7 +5,8 @@ const UNI_APP = { ...@@ -5,7 +5,8 @@ const UNI_APP = {
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
apiUrl: 'http://192.168.1.22', //java端域名请求头 // apiUrl: 'http://192.168.1.22', //java端域名请求头
apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/' qn_base_url: 'https://qn-static.banshouhui.com/self-support/'
} }
......
...@@ -5,7 +5,8 @@ const UNI_APP = { ...@@ -5,7 +5,8 @@ const UNI_APP = {
banshou: 'https://m.test.ibanshou.cn', //扳手app banshou: 'https://m.test.ibanshou.cn', //扳手app
}, },
systemUrl: { systemUrl: {
apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头 // apiUrl: 'https://system.dev.banshouhui.com', //java端域名请求头
apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/' qn_base_url: 'https://qn-static.banshouhui.com/self-support/'
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import "./../.env.js"; import "./../.env.js";
import { AnalysysAgent } from "@/utils/analysys_paas.js"; import { AnalysysAgent } from "@/utils/analysys_paas.js";
import util from "@/utils/util.js"; import util from "@/utils/util.js";
import login from "@/utils/login.js";
export default { export default {
globalData: { globalData: {
// 开发环境 // 开发环境
...@@ -74,16 +75,19 @@ export default { ...@@ -74,16 +75,19 @@ export default {
} }
}, },
}, },
onLaunch: function () { onLaunch: async function () {
// 应用初始化(全局只触发一次) // 应用初始化(全局只触发一次)
AnalysysAgent.registerSuperProperty("platform", "self-support"); AnalysysAgent.registerSuperProperty("platform", "self-support");
this.getSystemInfo() this.getSystemInfo()
// 版本更新 // 版本更新
this.updateApp(); this.updateApp();
}, },
onShow: function () { onShow: async function () {
// 应用启动,或从后台进入前台显示 // 应用启动,或从后台进入前台显示
this.autoLogin();
// 等待自动授权登录接口调用结束
await this.autoLogin();
}, },
onHide: function () { onHide: function () {
// 应用从前台进入后台 // 应用从前台进入后台
...@@ -130,48 +134,38 @@ export default { ...@@ -130,48 +134,38 @@ export default {
}, },
/** /**
* 用户自动登录 * 微信用户自动登录
*/ */
autoLogin() { async autoLogin() {
let that = this; let that = this;
uni.login({ await login.oauth().then(async res => {
async success(res) { if (res.code) {
if (res.code) { let params = {
let params = { code: res.code,
code: res.code, wxAppNo: that.globalData.wxAppNo, // 自营平台小程序
wxAppNo: that.globalData.wxAppNo, // 自营平台小程序 };
}; let result = await that.$u.api.loginWechatAuth(params)
let result = await that.$u.api.loginWechatAuth(params); if (result && result.code == 200 && result.data) {
if (result) { that.setUserData(result.data);
if (result.code == 200 && result.data) { }
that.setUserData(result.data); } else {
} uni.showModal({
} else { title: "登录失败",
uni.showModal({ content: "未获取到code",
title: "请求失败", });
content: result.message, }
showCancel: false, })
});
}
uni.hideLoading();
} else {
uni.showModal({
title: "登录失败",
content: "未获取到code",
});
}
},
fail() {},
});
}, },
setUserData(userInfo) { setUserData(userInfo) {
if (userInfo && userInfo.token) { if (userInfo && userInfo.token) {
// 如果已经登录则直接获取相关信息 // 如果已经登录则直接获取相关信息
util.setOpenid(userInfo.wxopenid);
this.$u.vuex('vuex_token', userInfo.token); this.$u.vuex('vuex_token', userInfo.token);
uni.setStorageSync("user-info", userInfo); this.$u.vuex('vuex_user', userInfo);
this.$u.vuex('vuex_wx_uid', userInfo.wxopenid);
} else { } else {
this.$u.vuex('vuex_token', ''); this.$u.vuex('vuex_token', '');
this.$u.vuex('vuex_user', null);
this.$u.vuex('vuex_wx_uid', '');
} }
}, },
......
...@@ -12,8 +12,10 @@ let learnApiFun = function(vm){ ...@@ -12,8 +12,10 @@ let learnApiFun = function(vm){
let ChapterDetails = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/chapter-sections',params); let ChapterDetails = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/chapter-sections',params);
/* 获取课程节信息*/ /* 获取课程节信息*/
let CourseSection = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/section-details',params); let CourseSection = async (params = {}) => await vm.$u.get(collegeApiUrl+'/v1/section-details',params);
/* 更新学习情况*/
let updateLearnCourses = async (params = {}) => await vm.$u.post(collegeApiUrl+'/v1/update-learn-courses',params);
const learnApi = { const learnApi = {
getTrainingNoticeList,CourseList,ChapterDetails,CourseSection getTrainingNoticeList,CourseList,ChapterDetails,CourseSection,updateLearnCourses
} }
return learnApi return learnApi
} }
......
import util from '@/utils/util.js' import util from '@/utils/util.js'
let orderApiFun = function(vm){ let orderApiFun = function(vm){
let listByRecommendOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/recommend/order', params); let listByRecommendOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/recommend/order', params);
/** /**
* 工单数量查询接口 * 工单数量查询接口
*/ */
let listOrderCount = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/queryOrdersCount/V2', params); let listOrderCount = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/queryOrdersCount/V2', params);
/** /**
* 工单列表接口 * 工单列表接口 wxh-worker-rest/rest/order/revision/{token}/list
*/ */
let listOrder = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/revision/list', params); let listOrder = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/list', params);
/** /**
* 获取师傅的预约日历 * 获取师傅的预约日历
*/ */
let workerCalendar = async (params = {}) => await vm.$u.get('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/wokerOrder/appointment/calendar', params); let workerCalendar = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/'+ vm.vuex_token+'/wokerOrder/appointment/calendar', params);
/** /**
* 师傅预约 * 师傅预约
*/ */
let workerAppointment = async (params = {}) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/order/traceAndAppointment/traceOrder/'+ vm.vuex_token+'/order/{orderId}', params,{'content-type': 'application/x-www-form-urlencoded'}); let workerAppointment = async (params = {}) => await vm.$u.post('/wxh-worker-rest/rest/order/traceAndAppointment/traceOrder/'+ vm.vuex_token+'/order/{orderId}', params,{'content-type': 'application/x-www-form-urlencoded'});
// 联系顾客时间更新接口,暂时没有 // 联系顾客时间更新接口,暂时没有
/** /**
* 师傅签到接口 * 师傅签到接口
*/ */
let maintainWorkerCheckin = async (params = {}) => await vm.$u.post('http://apidoc.banshouhui.com:3000/mock/31/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/{orderId}/maintainWorkerCheckin', params,{'content-type': 'application/x-www-form-urlencoded'}); let maintainWorkerCheckin = async (params = {},orderId) => await vm.$u.post(prefix + '/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/'+orderId+'/maintainWorkerCheckin', params,{'content-type': 'application/x-www-form-urlencoded'});
/**
* 订单详情查询
*/
let orderDetail = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/'+ vm.vuex_token+'/'+params.orderId, params);
/* 过程反馈查询接口 */
let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params)
/**
* 查询工单操作记录列表接口
*/
let listOrderRecord = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/record/'+ vm.vuex_token+'/listOrderRecord/'+params.orderId, params);
/**
* 接单
*/
let orderAccept= async (params = {},orderId) => await vm.$u.get('/wxh-worker-rest/rest/'+ vm.vuex_token+'/order/'+orderId+'/accept', params);
/**
* 抢单
*/
let orderGan = async (params = {},orderId) => await vm.$u.post('/wxh-worker-rest/rest/order/revision/applets/'+ vm.vuex_token+'/order/acceptAppletsOrder', params,{'content-type': 'application/x-www-form-urlencoded'});
const orderApi = { const orderApi = {
...@@ -35,7 +57,13 @@ let orderApiFun = function(vm){ ...@@ -35,7 +57,13 @@ let orderApiFun = function(vm){
listOrder, listOrder,
workerCalendar, workerCalendar,
workerAppointment, workerAppointment,
maintainWorkerCheckin maintainWorkerCheckin,
orderDetail,
listOrderRecord,
orderAccept,
orderGan,
maintainWorkerCheckin,
feedbackConfig
} }
return orderApi return orderApi
} }
......
...@@ -40,7 +40,6 @@ const install = (Vue, vm) => { ...@@ -40,7 +40,6 @@ const install = (Vue, vm) => {
// toLoginPage() // toLoginPage()
// return false // return false
// } // }
// // const token = app && app.globalData && app.globalData.token || ''
if(config.url.indexOf('access-token=')>=0 && config.params['access-token']){ if(config.url.indexOf('access-token=')>=0 && config.params['access-token']){
// 给默认参数增加access-token (Java端) // 给默认参数增加access-token (Java端)
if(reg.test(config.url)){ if(reg.test(config.url)){
...@@ -55,14 +54,13 @@ const install = (Vue, vm) => { ...@@ -55,14 +54,13 @@ const install = (Vue, vm) => {
} }
// config.header.token = vm.vuex_token || 'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b'; // config.header.token = vm.vuex_token || 'RTOKENe56f873b5823477fa2e15572f8fa7eb3a5fb6f7b';
config.header['x-requested-with'] = 'xmlhttprequest'; config.header['x-requested-with'] = 'xmlhttprequest';
return config; return config;
} }
function getCode(res){ function getCode(res){
const result = res.data const result = res.data || res
let code let code
if(res.hasOwnProperty('statusCode')){ if(result.hasOwnProperty('statusCode')){
code = res.statusCode code = res.statusCode
}else if(result.hasOwnProperty('code')){ }else if(result.hasOwnProperty('code')){
code = result.code code = result.code
...@@ -94,13 +92,7 @@ const install = (Vue, vm) => { ...@@ -94,13 +92,7 @@ const install = (Vue, vm) => {
message:msg message:msg
}; };
case 401: case 401:
//需要登录的接口,当token 过期时,清掉本地token,到登录页面 // token失效,跳转登录
// if (!token) {
// uni.navigateTo({
// url: '/pages/login/index'
// });
// return;
// }
toLoginPage() toLoginPage()
case 403://没有权限访问 case 403://没有权限访问
case 500: case 500:
......
page { page {
background-color: #fafafa; background-color: #f4f5f7;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
......
<template> <template>
<view class="order-cell"> <view class="order-view" @click="handleClickCell">
<view class="order-view" @click="handleClickCell"> <view class="order-top-view">
<view class="order-top-view"> <view class="left-view">
<view class="left-view"> <view :class="['tag-view', {'active': active}]">
<view :class="['tag-view', {'active': active}]"> {{ orderData.orderServiceType }}
{{ orderData.orderServiceType }}
</view>
<view class="store-view">{{ orderData.categoryName }}</view>
</view> </view>
<view class="right-view">{{ orderData.orderBusinessTypeText }}</view> <view class="store-view">{{ orderData.categoryName }}</view>
</view> </view>
<view class="content-view"> <view class="right-view">{{ orderData.orderBusinessTypeText }}</view>
<view class="info-view" v-for="(item, key) in infoTexts" :key="key"> </view>
<text>{{item + ':'}}</text> <view class="content-view">
<text>{{orderData[key]}}</text> <view class="info-view" v-for="(item, key) in infoTexts" :key="key">
<text>{{item + ':'}}</text>
<text>{{orderData[key]}}</text>
</view>
<view class="address-view">
<view class="address-left-view">
<image class="address-image" :src="dizhiImage" mode="widthFix"></image>
<text>{{orderData.contactAddress }}</text>
</view> </view>
<view class="address-view"> <view v-if="showDistance">
<view class="address-left-view"> {{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km
<image class="address-image" :src="dizhiImage" mode="widthFix"></image>
<text>{{orderData.contactAddress }}</text>
</view>
<view v-if="showDistance">
{{getDistance(orderData.contactAddressLatitud,orderData.contactAddressLongitud)}}km
</view>
</view> </view>
</view> </view>
</view>
<view class="line-view"></view> <view class="line-view"></view>
<view class="reason-view" v-if="showReason"><text>未通过原因:</text> <view class="reason-view" v-if="showReason"><text>未通过原因:</text>
<text class="reason-text">{{orderData.auditResults.remark}}</text> <text class="reason-text">{{orderData.auditResults.remark}}</text>
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
<view> <view>
<view v-if="showCountTime" class="bottom-left-view"> <view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view> <view :class="['bottom-tag-view', {'will': orderData.currentWillOverTime}]">{{tagText}}</view>
<u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" <u-count-down :timestamp="orderData.currentWillOverTime || orderData.currentOverTime" font-size="44"
font-size="44" color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down> color="#FF930D" @change="handleChange" ref="order-count-down"></u-count-down>
</view> </view>
<view v-else-if="showTime"> <view v-else-if="showTime">
<text>{{timeTitle}}</text> <text>{{timeTitle}}</text>
<text>{{timeText}}</text> <text>{{timeText}}</text>
</view>
</view> </view>
<u-button class="right-btn" @click.stop="handleClick" :custom-style="buttonStyle" type="primary"
shape="circle">
{{orderText}}
</u-button>
</view> </view>
<u-button class="right-btn" @click.stop="handleClick" :custom-style="buttonStyle" type="primary"
shape="circle">
{{orderText}}
</u-button>
</view> </view>
</view> </view>
</view> </view>
...@@ -187,7 +185,7 @@ ...@@ -187,7 +185,7 @@
}] }]
}, },
buttonDisabled() { buttonDisabled() {
return this.orderData.orderStatus == 4 || this.orderData.orderStatus == 6 return this.orderType == 4 || this.orderType == 6
}, },
dizhiImage() { dizhiImage() {
return process.uniEnv.qn_base_url + 'shouye-dizhi.png' return process.uniEnv.qn_base_url + 'shouye-dizhi.png'
...@@ -251,138 +249,137 @@ ...@@ -251,138 +249,137 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.order-cell { .order-view {
padding-bottom: 20rpx; width: 100%;
background-color: #FFFFFF;
border-radius: 12rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.order-view { .order-top-view {
width: 100%; display: flex;
background-color: #FFFFFF; align-items: center;
border-radius: 12rpx; justify-content: space-between;
padding: 30rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.order-top-view { .left-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
.left-view {
display: flex;
align-items: center;
.tag-view { .tag-view {
width: 84rpx; text-align: center;
height: 40rpx; width: 84rpx;
color: #FFFFFF; height: 40rpx;
border-radius: 8rpx; color: #FFFFFF;
background-image: linear-gradient(to right, #FF930D, #FFC174); border-radius: 8rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
&.active {
background-image: linear-gradient(to right, #2272FF, #47ABFF);
}
}
.store-view { &.active {
color: #333333; background-image: linear-gradient(to right, #2272FF, #47ABFF);
font-size: 36rpx;
font-weight: bold;
margin-left: 20rpx;
} }
} }
.right-view { .store-view {
width: 100rpx;
height: 40rpx;
background-color: #F4F5F7;
border-radius: 20rpx;
color: #333333; color: #333333;
font-size: 22rpx; font-size: 36rpx;
line-height: 40rpx; font-weight: bold;
margin-left: 20rpx;
} }
} }
.content-view { .right-view {
.info-view { text-align: center;
text-align: left; width: 100rpx;
color: #333333; height: 40rpx;
font-size: 26rpx; background-color: #F4F5F7;
margin-top: 12rpx; border-radius: 20rpx;
margin-bottom: 12rpx; color: #333333;
} font-size: 22rpx;
line-height: 40rpx;
}
}
.content-view {
.info-view {
text-align: left;
color: #333333;
font-size: 26rpx;
margin-top: 12rpx;
margin-bottom: 12rpx;
}
.address-view { .address-view {
display: flex;
align-items: flex-start;
justify-content: space-between;
color: #333333;
font-size: 24rpx;
margin-top: 12rpx;
.address-left-view {
display: flex; display: flex;
align-items: center;
align-items: flex-start; align-items: flex-start;
justify-content: space-between;
color: #333333;
font-size: 24rpx;
margin-top: 12rpx;
.address-left-view { .address-image {
display: flex; width: 26rpx;
align-items: center; height: 28rpx;
align-items: flex-start; margin-right: 8rpx;
flex-shrink: 0;
.address-image { margin-top: 4rpx;
width: 26rpx;
height: 28rpx;
margin-right: 8rpx;
flex-shrink: 0;
margin-top: 4rpx;
}
} }
.address-right-view {}
} }
}
.line-view { .address-right-view {}
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
margin-top: 30rpx;
} }
}
.reason-view { .line-view {
text-align: left; background-color: #F4F5F7;
margin-top: 30rpx; height: 2rpx;
font-size: 26rpx; width: 100%;
color: #666666; margin-top: 30rpx;
}
.reason-text { .reason-view {
color: #FA5A49; text-align: left;
} margin-top: 30rpx;
font-size: 26rpx;
color: #666666;
.reason-text {
color: #FA5A49;
} }
}
.bottom-view { .bottom-view {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 30rpx;
.bottom-left-view {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
margin-top: 30rpx;
.bottom-left-view { .bottom-tag-view {
display: flex; text-align: center;
align-items: center; width: 52rpx;
height: 52rpx;
.bottom-tag-view { border-radius: 26rpx;
width: 52rpx; line-height: 56rpx;
height: 52rpx; color: #FFFFFF;
border-radius: 26rpx; font-size: 26rpx;
line-height: 56rpx; background-color: #FA5A49;
color: #FFFFFF; margin-right: 20rpx;
font-size: 26rpx;
background-color: #FA5A49;
margin-right: 20rpx;
&.will { &.will {
background-color: #FF930D; background-color: #FF930D;
}
} }
} }
.right-btn {}
} }
.right-btn {}
} }
} }
</style> </style>
<template>
<view :class="['content', {'fixed': fixed}]">
<u-navbar :is-back="false" :is-fixed="false" :background="{ background: 'transparent' }" :border-bottom="false">
<text class="title-view">{{title}}</text>
</u-navbar>
<slot></slot>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
default: '充电桩自营平台'
},
fixed: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.content {
height: 100vh;
background-color: #f4f5f7;
padding: 0rpx 30rpx 0 30rpx;
overflow-y: auto;
&.fixed {
display: flex;
flex-direction: column;
}
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
}
}
</style>
{ {
"easycom": { "easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" "autoscan": true,
"custom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
}
}, },
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
...@@ -14,7 +17,9 @@ ...@@ -14,7 +17,9 @@
{ {
"path": "pages/order/index", "path": "pages/order/index",
"style": { "style": {
"navigationBarTitleText": "订单" "navigationBarTitleText": "订单",
"navigationStyle": "custom",
"disableScroll": true
} }
}, },
{ {
...@@ -203,13 +208,61 @@ ...@@ -203,13 +208,61 @@
"navigationStyle": "custom"// 隐藏系统导航栏 "navigationStyle": "custom"// 隐藏系统导航栏
} }
} },
{
"path": "pages/photo/index",
"style": {
"navigationBarTitleText": "拍照小工具",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
}
},
{
"path": "pages/photo/setting",
"style": {
"navigationBarTitleText": "水印设置",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
// "navigationBarBackgroundColor": "#333333",
// "navigationBarTextStyle": "#FFFFFF",
// "disableScroll": true
}
},
{
"path": "pages/photo/take",
"style": {
"navigationStyle":"custom",
"navigationBarTitleText": "拍照",
"navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "#FFFFFF",
"disableScroll": true
}
},
{
"path": "pages/photo/preview",
"style": {
"navigationBarTitleText": "照片预览",
"navigationBarBackgroundColor":"#333333",
"backgroundColor":"#FFFFFF",
"navigationBarTextStyle":"white"
}
},
{
"path": "pages/photo/list",
"style": {
"navigationBarTitleText": "规范展示",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F4F5F7"
}, },
"tabBar": { "tabBar": {
"color": "#7A7E83", "color": "#7A7E83",
...@@ -251,6 +304,16 @@ ...@@ -251,6 +304,16 @@
"path": "pages/index/index", //启动页面,必选 "path": "pages/index/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{
"name": "订单列表", //模式名称
"path": "pages/order/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "拍照小工具", //模式名称
"path": "pages/photo/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{ {
"name": "入驻首页", "name": "入驻首页",
"path": "pages/settle/index", "path": "pages/settle/index",
......
This diff is collapsed.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</view> </view>
<view class="video" v-for="key in item.section" @click=details(key.id)> <view class="video" v-for="key in item.section" @click=details(key.id)>
<view class="video_1" > <view class="video_1" >
<view class="text" v-text="key.ware=='0'?'视频':'图文'"> <view class="text" v-text="wareType(key.ware)">
</view> </view>
<text>1-{{key.order}}</text> <text>1-{{key.order}}</text>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
methods: { methods: {
//获取章节详情 //获取章节详情
getCapterDetails() { getCapterDetails() {
console.log(1111111) console.log('获取章节详情')
this.$u.api this.$u.api
.ChapterDetails(this.params) .ChapterDetails(this.params)
.then((res) => { .then((res) => {
...@@ -105,6 +105,27 @@ ...@@ -105,6 +105,27 @@
uni.navigateTo({ uni.navigateTo({
url:"./section?section_id=" + id url:"./section?section_id=" + id
}) })
},
wareType(type){
let res = "";
switch (type) {
case "":
res = "图文";
break;
case "0":
case "0,1":
case "0,1,2":
res = "视频";
break;
case "1":
res = "ppt";
break;
case "2":
case "1,2":
res = "pdf";
break;
}
return res;
} }
} }
} }
......
<template> <template>
<view> <view class="learn-vedio" v-if="isShowVideo">
<view class="title"> <view class="uni-padding-wrap uni-common-mt">
{{CourseSectionlist.name}} <view><video
</view> object-fit="cover"
<view class="content" v-html="CourseSectionlist.content"> class="course-video"
{{CourseSectionlist.content}} id="courseVideo"
</view> :src="courseSrc"
</view> @play="playCourse"
@error="videoErrorCallback"
controls
></video
></view>
<view class="title-content">
<view class="item-content">
<view class="item-st">
<image style="width: 80rpx; height: 36rpx" :src="kcImage"></image>
<text class="item-st-text">{{
courseTitle.split(" ") ? courseTitle.split(" ")[0] : ""
}}</text>
</view>
<view class="item-title">{{
courseTitle.split(" ") ? courseTitle.split(" ")[1] : ""
}}</view>
</view>
<view
>接单操作须知有助你快速了解充电桩安装业务,提高接单效率,请认真查看及学习。</view
>
</view>
<view class="learn-view" v-if="courseId >= 0">
<view class="learn-view-title">视频内容介绍</view>
<!-- <view
class="learn-list"
v-for="(item, key) in courseOutlines[courseId]"
:key="key"
> -->
<view class="learn-list-item">{{ item }}</view>
</view>
</view>
</view>
<view v-else>
<view class="title">
{{CourseSectionlist.name}}
</view>
<view class="content" v-html="CourseSectionlist.content">
{{CourseSectionlist.content}}
</view>
</view>
</view>
</template> </template>
<script> <script>
export default { let app = getApp();
data() { export default {
return { data() {
CourseSectionlist:null, return {
section_id:{ courseId: "",
section_id:0 courseStatus: 0,
} courseSrc: "",
} courseTitle: "",
}, courseDesc: "",
onLoad(id) { currentIndex: -1, // 第几个视频
this.section_id.section_id = id.section_id section_id:0,
this.getCourseSection() isShowVideo: false,
}, CourseSectionlist: {},//节信息
methods: { };
getCourseSection() { },
this.$u.api computed: {
.CourseSection(this.section_id) courseOutlines() {
.then((res) => { // 视频内容介绍
if (res.code == 200) { return {
if (res.data) { 1: [
this.CourseSectionlist = res.data; "1、考核规则:接单及时率",
console.log("--------") "2、考核规则:上门及时率",
console.log(this.CourseSectionlist) "3、考核规则:安装完工率",
if (res.data.length < 5) { "4、考核规则:资料提交及时率",
//判断接口返回数据量小于请求数据量,则表示此为最后一页 "5、考核规则:安装完工率",
this.isLoadMore = true; "6、考核规则:客户满意度",
this.loadStatus = "nomore"; ],
} else { 2: ["1、必备材料4大类", "2、施工工具准备"],
this.isLoadMore = false; 3: [
} "1、接线安装工艺标准",
} else { "2、PVC、镀锌管电缆管明敷",
this.isLoadMore = true; "3、电缆敷设的防火要求",
this.loadStatus = "nomore"; "4、电源点标识",
} "5、配电箱接线及安装",
} else { "6、管线敷设接头处理",
//接口请求失败的处理 "7、充电桩内部接线",
uni.showToast({ "8、配电箱安装",
title: res.message, ],
icon: "none" 4: ["1、勘测环节录单要求", "2、安装环节录单要求"],
}); };
this.isLoadMore = false; },
if (this.params.start > 0) { kcImage() {
this.page -= 5; return process.uniEnv.qn_base_url + "kc.png";
} },
} },
}) onLoad(e) {
.catch((err) => { this.courseSrc = 'https://qn-static.banshouhui.com/self-support/videoen.mp4';
uni.showToast({ this.courseTitle = '大吉大利';
title: err, this.courseDesc = '今晚吃鸡';
icon: "none", this.section_id = e.section_id
}); this.getCourseSection({section_id:e.section_id})
this.isLoadMore = false; },
if (this.params.start > 0) { onReady: function (res) {
this.page -= 5; // #ifndef MP-ALIPAY
} this.videoContext = uni.createVideoContext("courseVideo");
}); // #endif
}, },
methods: {
videoErrorCallback: function (e) {
uni.showModal({
content: e.target.errMsg,
showCancel: false,
});
},
getRandomColor: function () {
const rgb = [];
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16);
color = color.length == 1 ? "0" + color : color;
rgb.push(color);
}
return "#" + rgb.join("");
},
playCourse: function (e) {
if(this.courseStatus && (this.courseStatus == "1"||this.courseStatus == 1)) {
return
} }
this.changeCourseStatus();
},
changeCourseStatus() {
let that = this;
if (that.courseId) {
that.$u.api
.saveCourseRate({
courseId: that.courseId,
})
.then((res) => {
if (res.code !== 200) {
uni.showToast({
icon: "none",
title: "更新课程状态失败",
});
}
});
} else {
uni.showToast({
title: "课程ID为空,请重新选择课程",
});
}
},
getCourseSection(param) {
this.$u.api
.CourseSection(param)
.then((res) => {
if (res.code == 200) {
if (res.data) {
this.CourseSectionlist = res.data;
console.log("--------")
console.log(this.CourseSectionlist)
let wareVal = this.CourseSectionlist.ware;
this.isShowVideo = wareVal == "0";
}
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none",
});
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
});
} }
},
};
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.title{ .learn-vedio {
text-align: center; background-color: #f4f5f7;
font-size: 45rpx; position: absolute;
font-weight: 700; top: 0;
margin: 24rpx; left: 0;
} width: 100%;
.content{ height: 100%;
font-size: 30rpx; display: flex;
padding: 50rpx; flex-direction: column;
} overflow-y:auto;
}
.course-video {
width: 100%;
}
.course-title {
font-size: 36rpx;
font-weight: 700;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.course-desc {
margin-left: 60rpx;
}
.title-content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
background-color: #ffffff;
color: #999999;
font-size: 24rpx;
.item-content {
display: flex;
align-items: center;
}
.item-st {
width: 80rpx;
height: 36rpx;
padding-right: 2rpx;
text-align: center;
margin-right: 20rpx;
line-height: 24rpx;
position: relative;
.item-st-text {
color: #ffffff;
position: absolute;
font-size: 16rpx;
left: 20rpx;
top: 8rpx;
line-height: 28rpx;
}
}
.item-title {
color: #333333;
font-size: 44rpx;
font-weight: bold;
}
}
.item-content {
display: flex;
padding-bottom: 30rpx;
}
.item-title {
color: #333333;
font-size: 28rpx;
}
.learn-view {
background-color: #ffffff;
border-radius: 12rpx;
padding: 38rpx 30rpx 30rpx 30rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
color: #333333;
.learn-view-title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.learn-list {
.learn-list-item {
font-size: 28rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
color: #333333;
}
.line-view {
background-color: #f4f5f7;
height: 2rpx;
width: 100%;
}
}
}
</style> </style>
...@@ -53,30 +53,40 @@ export default { ...@@ -53,30 +53,40 @@ export default {
} }
}, },
methods: { methods: {
// 授权用户信息 // 微信授权用户信息
getUserProfile() { getUserProfile() {
var that = this var that = this
uni.getUserProfile({ if(uni.getUserProfile) {
desc: '用于授权登录', // 每次触发 uni.getUserProfile 均会弹出授权窗口,用户授权后可成功获取用户信息
success: function (res) { uni.getUserProfile({
const userInfo = res.userInfo; desc: '用于授权登录',
app.globalData.authUserInfo = userInfo success: function (res) {
app.globalData.authUserInfo.nickName = app.globalData.authUserInfo.nickName || '' const userInfo = res.userInfo;
app.globalData.authUserInfo.avatarUrl = app.globalData.authUserInfo.avatarUrl || '' app.globalData.authUserInfo = userInfo
uni.showLoading({ app.globalData.authUserInfo.nickName = app.globalData.authUserInfo.nickName || ''
title: '授权中..', app.globalData.authUserInfo.avatarUrl = app.globalData.authUserInfo.avatarUrl || ''
mask: true uni.showLoading({
}); title: '授权中..',
that.authLogin() mask: true
}, });
fail: function (res) { that.authLogin()
uni.showModal({ },
title: '授权失败', fail: function (res) {
content: '请允许获取用户信息的授权', uni.showModal({
showCancel: false title: '授权失败',
}); content: '请允许获取用户信息的授权',
} showCancel: false
}) });
}
})
} else {
// 可能由于账号配置,或者其他原因导致无法调起微信用户授权
uni.showModal({
title: '授权失败',
content: '请确认你的用户授权是否可用',
showCancel: false
});
}
}, },
authLogin() { authLogin() {
var that = this var that = this
......
This diff is collapsed.
<!-- 过程反馈 --> <!-- 过程反馈 -->
<template> <template>
<view class="feedback-box bg"> <view class="feedback-box bg">
<u-navbar back-icon-color="#FFFFFF" :background="background" title="过程反馈" title-color="#fff" :border-bottom="false"></u-navbar> <u-navbar back-icon-color="#FFFFFF" :background="background" title="过程反馈" titleColor="#FFFFFF" :border-bottom="false"></u-navbar>
<view class="content u-p-l-30 u-p-r-30"> <view class="content u-p-l-30 u-p-r-30">
<view class="width-320 u-m-t-20"> <!-- <view class="width-320 u-m-t-20">
<u-subsection <u-subsection
:bold="false" :bold="false"
:current="curNow" :current="curSub"
:list="list" :list="subList"
active-color="white" active-color="white"
bg-color="white" bg-color="white"
height="72" height="72"
...@@ -15,29 +15,54 @@ ...@@ -15,29 +15,54 @@
button-color="#2272FF" button-color="#2272FF"
border-radius="36" border-radius="36"
></u-subsection> ></u-subsection>
</view> -->
<view class="top-tab">
<u-tabs
:list="tabList"
:current="curTab"
height="80"
gutter="89"
bar-height="4"
bar-width="44"
bg-color="none"
active-color="#FFFFFF"
inactive-color="#FFFFFF"
font-size="32"
@change="changeTab"
></u-tabs>
</view> </view>
<!-- <view class="con-box">
</view> -->
<view class="con-box"> <view class="con-box">
<view class="title">{{feedback.own.title}}</view> <view class="title">{{feedback.own.title}}</view>
<view class="u-flex u-flex-wrap"> <view class="u-flex u-flex-wrap">
<view :class="{'txt-item':true,'active':true}" v-for="(txt,index) in feedback.own.list" :key="index"> <view
<text class="txt">{{txt}}</text> v-for="(item, index) in options[curTab]"
:key="index"
@click="changeOwn(index)"
:class="{'txt-item':true,'active': (trace.reasonRelegation == index)}">
<text class="txt">{{index}}</text>
</view> </view>
</view> </view>
</view> <u-gap height="30"></u-gap>
<view class="con-box">
<view class="title">{{feedback.type.title}}</view> <view class="title">{{feedback.type.title}}</view>
<view class="u-flex u-flex-wrap"> <view class="u-flex u-flex-wrap">
<view :class="{'txt-item':true,'active':false}" v-for="(txt,index) in feedback.type.list" :key="index"> <view
v-for="(txt, index) in options[curTab][trace.reasonRelegation]"
:key="index"
@click="changeType(txt)"
:class="{'txt-item':true,'active': (trace.reason == txt)}">
<text class="txt">{{txt}}</text> <text class="txt">{{txt}}</text>
</view> </view>
</view> </view>
<u-input class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input> <u-input v-show="showRemark" v-model="trace.remark" class="textarea" height="156" type="textarea" placeholder="请补充详细说明,以便于记录您的接单信用分"></u-input>
</view> </view>
<appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time> <appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view> </view>
<view class="u-m-60"> <view class="u-m-60">
<button class="btn">确定</button> <button class="btn" @click="submitFrom" :loading="submiting" :disabled="disabledSubmitBtn">确定</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -47,40 +72,139 @@ ...@@ -47,40 +72,139 @@
export default { export default {
data() { data() {
return { return {
orderId: null,
categoryId: null,
showRemark: false,
submiting: false,
background: { background: {
backgroundColor: 'none', backgroundColor: 'none',
}, },
// questionList: ['个人', '客户', '现场/客户'], tabList: [{name: '报单'}, {name: '改约'}],
curTab: 0,
feedback: { feedback: {
own:{ own:{
title:'问题归属', title:'问题归属',
list:['个人', '客户', '现场/客户'],
}, },
type:{ type:{
title:'问题类型', title:'问题类型',
list:['有事耽搁', '未带齐工具', '个人改约','其他']
}, },
appoint:{ appoint:{
title:'预约时间', title:'预约时间',
} }
}, },
list:['报备','预约'], config: null,
curNow: 1 options: [],
trace: {
reasonType: '', // 反馈类型
reasonRelegation: '', // 反馈归属
reason: '', // 反馈原因
appointmentDatetime: null, // 预约时间
appointmentDatetimeRange: '', // 预约时间段类型
nextTraceDatetime: '', // 下次跟踪时间
remark: '', // 备注
},
}; };
}, },
components:{ components:{
appointTime appointTime
}, },
watch: {
vuex_token(val) {
this.initPageData()
}
},
computed: {
disabledSubmitBtn() {
debugger
let self = this
if(self.trace.reasonType == '预约'
&& (self.trace.appointmentDatetime == null || self.trace.appointmentDatetimeRange == ''
|| self.trace.nextTraceDatetime == '')) {
return true
} else if(self.trace.reasonType != '预约'
&& (!self.trace.reasonType || !self.trace.reasonRelegation || !self.trace.reason)) {
return true
}
return false
},
},
async onLoad(e) {
this.orderId = 1
this.categoryId = 88
if(e) {
this.orderId = e.orderId || null
this.categoryId = e.categoryId || null
}
uni.showLoading({
title: "数据加载中",
mask: true
})
await this.initPageData()
},
methods: { methods: {
async initPageData() {
let self = this
let params = {categoryId: self.categoryId}
let res = await self.$u.api.feedbackConfig(params)
if(res && res.code == 200) {
self.config = res.data
self.initParams()
self.buildConfig()
}
uni.hideLoading()
},
buildConfig() {
let self = this
if(self.config) {
let tabs = Object.keys(self.config)
let list = Object.values(self.config)
tabs.forEach(function(tab, index){
self.tabList[index] = {name: tab}
self.options[index] = list[index]
})
}
},
initParams() {
let self = this
if(self.config) {
let tabs = Object.keys(self.config)
let list = Object.values(self.config)
let relegation = Object.keys(list[self.curTab])[0]
let types = Object.values(list[self.curTab][relegation])
self.trace.reasonType = tabs[self.curTab]
self.trace.reasonRelegation = relegation
self.trace.reason = types[0]
if(self.trace.reasonType == '改约') {
self.showRemark = true
} else {
self.showRemark = false
self.trace.remark = ''
}
}
},
/** /**
* 拒单 * 切换tab项
*/ */
rejectOrder() { changeTab(index) {
console.log("点击拒单") this.curTab = index;
this.initParams()
},
changeOwn(key) {
let self = this
self.trace.reasonRelegation = key
self.trace.reason = self.options[self.curTab][key][0]
}, },
sectionChange(index) { changeType(key) {
this.curNow = index; this.trace.reason = key
}, },
/**
* 拒单
*/
// rejectOrder() {
// console.log("点击拒单")
// },
weekChange(data){ weekChange(data){
// 点击下一周 // 点击下一周
console.log(data,'week-data') console.log(data,'week-data')
...@@ -93,6 +217,21 @@ ...@@ -93,6 +217,21 @@
// 时间段选择变化 // 时间段选择变化
console.log(data,'week-data') console.log(data,'week-data')
}, },
async submitFrom() {
let self = this
self.orderId = 666
if(!self.orderId) {
uni.showToast({
icon:error,
title:"工单ID不能为空"
})
return false
}
self.submiting = true
let res = await self.$u.api.traceAndAppointment(self.trace, self.orderId)
self.submiting = false
},
} }
} }
</script> </script>
...@@ -107,12 +246,28 @@ ...@@ -107,12 +246,28 @@
background-size: 750rpx 600rpx; background-size: 750rpx 600rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.feedback-box {
.header {
padding: 12rpx 30rpx 40rpx 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
.title {
font-size: 40rpx;
font-weight: bold;
color: #FFFFFF;
}
}
}
/deep/ .u-subsection{ /deep/ .u-subsection{
padding:4rpx!important; padding:4rpx!important;
} }
.top-tab{
text-align: center;
}
.con-box{ .con-box{
margin-top:30rpx; margin-top:30rpx;
padding:30rpx 30rpx 30rpx 20rpx; padding: 30rpx 30rpx 28rpx 30rpx;
border-radius: 12rpx; border-radius: 12rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
.title{ .title{
...@@ -170,6 +325,19 @@ ...@@ -170,6 +325,19 @@
height:0; height:0;
} }
} }
.btn{
padding:30rpx;
border-radius: 52rpx;
line-height: 44rpx;
font-size:32rpx;
text-align: center;
background-color: #2272FF;
color:#fff;
&::after{
content:'';
height:0;
}
}
.width-320{ .width-320{
width:320rpx; width:320rpx;
} }
......
This diff is collapsed.
<template>
<view class="backView">
<view class="ph-pr-arr" v-for="(dataItem, index) in list" :key="index">
<template v-if="dataItem.data.length > 0">
<view class="topTitle"><text>{{ dataItem.title }}</text></view>
<view class="ph-pr-content">
<view v-for="(item,ikey) in dataItem.data"
:class="param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'"
@click="itemClick(dataItem.type, item, ikey)" :key="item.id">
<text class="itemTitle">{{item.name}}</text>
</view>
</view>
</template>
</view>
<u-button class="ph-pr-button" type="primary" shape="circle" @click="handleClick"
:hover-class="selectedAll ? '' : 'none'" :custom-style="buttonStyle">下一步</u-button>
</view>
</template>
<script>
export default {
data() {
return {
classifyList: [],
systemList: [],
brandList: [],
param: {
classifyId: '',
systemId: '',
brandId: '',
},
brandName: '',
selectedAll: false,
}
},
computed: {
list() {
return [{
title: '请选择类别',
type: 'classifyId',
data: this.classifyList
},
{
title: '请选择系统',
type: 'systemId',
data: this.systemList
},
{
title: '请选择品牌',
type: 'brandId',
data: this.brandList
}
]
},
buttonStyle() {
return this.selectedAll ? {
'color': '#FFFFFF',
'background-color': '#2272FF;',
'width': '600rpx',
'height': '104rpx'
} : {
'color': '#FFFFFF',
'background-color': '#D1D4D4;',
'width': '600rpx',
'height': '104rpx'
}
}
},
onLoad(e) {
getApp().trackPage('选择产品页')
this.getRelationDictionaryV2()
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/photo/product',
imageUrl: '',
success() {},
fail() {}
}
return shareObj
},
methods: {
getRelationDictionaryV2: function() {
this.$u.cloudApi.getRelationDictionaryV2().then(res => {
if (res && res.result) {
this.classifyList = res.result
this.param.classifyId = res.result[0].id
this.systemList = res.result[0].child
}
})
},
//选择 点击
itemClick: function(type, item, ikey) {
switch (type) {
case 'classifyId':
this.param = {
classifyId: item.id,
systemId: '',
brandId: ''
}
this.selectedAll = false
this.systemList = this.classifyList[ikey].child
this.brandList = []
break
case 'systemId':
this.param = {
classifyId: this.param.classifyId,
systemId: item.id,
brandId: ''
}
this.selectedAll = false
this.brandList = this.systemList[ikey].child
break
case 'brandId':
this.param.brandId = item.id
this.selectedAll = true
this.brandName = item.name
break
default:
break
}
},
// 点击下一步
handleClick() {
// 点击下一步设置全局拍照品牌品类
if (!this.selectedAll) {
return
}
const globalData = getApp().globalData
// if (!globalData.token) {
// uni.navigateTo({
// url: '/pages/login/wxlogin'
// })
// return
// }
let keys = ['brandId', 'brandName', 'classifyId', 'systemId']
keys.map(key => {
globalData.photo.product[key] = this[key] || this.param[key]
})
uni.navigateTo({
url: '/pages/photo/list' +
'?brandId=' + this.param.brandId +
'&brand=' + this.brandName +
'&classifyId=' + this.param.classifyId +
'&systemId=' + this.param.systemId,
})
}
}
}
</script>
<style>
.backView {
background-color: #F4f5f7;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.topTitle {
margin-top: 50rpx;
padding-left: 30rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
}
.ph-pr-content {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
padding: 22rpx 22rpx;
}
.ph-pr-arr {
width: 100%;
}
.item-view {
background-color: #FFFFFF;
/* width: 548rpx; */
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #666666;
}
.select-item-view {
background-color: #2272FF;
margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #FFFFFF;
}
.ph-pr-button {
position: absolute;
bottom: 76rpx;
font-size: 32rpx;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
mode="aspectFill" mode="aspectFill"
v-for="(src, key) in fileItem.placeholderImages" v-for="(src, key) in fileItem.placeholderImages"
:src="fileItem.imgs.length > key ? fileItem.imgs[key] : src" :src="fileItem.imgs.length > key ? fileItem.imgs[key] : src"
:key="src + key" :key="key"
@click="handleClick(fileItem, index, key)" @click="handleClick(fileItem, index, key)"
></image> ></image>
</view> </view>
......
...@@ -76,9 +76,57 @@ function signup(data) { ...@@ -76,9 +76,57 @@ function signup(data) {
} }
function oauth() {
return new Promise(function (resolve, reject) {
uni.getProvider({
service: 'oauth',
success: function (res) {
console.log(res.provider)
if (~res.provider.indexOf('weixin')) {
// weixin 微信登录
login('weixin').then(res=>{resolve(res)}).catch(err=>{reject(err)})
} else if (~res.provider.indexOf('qq')) {
// qq QQ登录
login('qq').then(res=>{resolve(res)}).catch(err=>{reject(err)})
} else if (~res.provider.indexOf('sinaweibo')) {
// sinaweibo 新浪微博登录
login('sinaweibo').then(res=>{resolve(res)}).catch(err=>{reject(err)})
} else if (~res.provider.indexOf('xiaomi')) {
// xiaomi 小米登录
login('xiaomi').then(res=>{resolve(res)}).catch(err=>{reject(err)})
} else if (~res.provider.indexOf('univerify')) {
// univerify 一键登录 App
login('univerify').then(res=>{resolve(res)}).catch(err=>{reject(err)})
} else if (~res.provider.indexOf('apple')) {
// apple Apple登录
login('apple').then(res=>{resolve(res)}).catch(err=>{reject(err)})
}
}
});
});
}
function login(provider) {
return new Promise(function (resolve, reject) {
uni.login({
provider: provider,
success(res) {
console.log(JSON.stringify(res));
resolve(res);
},
fail(err) {
console.log(JSON.stringify(err));
reject(err);
}
});
});
}
module.exports = { module.exports = {
appLogin: appLogin, appLogin: appLogin,
authorization: authorization, authorization: authorization,
signup: signup signup: signup,
oauth: oauth
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment