Commit adf21c8d authored by 李超鹏's avatar 李超鹏

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/pages/order/complete.vue
parents c8ecc865 decf9de4
......@@ -106,29 +106,28 @@ export default {
} catch (a) {
}
},
async getBaseInfo(vm, callBack) {
uni.showLoading({
title: "加载中……",
});
const res = await vm.$u.api.getSettleBaseInfo();
console.log(res, "res");
if (res.code !== 200) {
uni.showToast({
title: (res && res.message) || "获取基本信息错误",
icon: "none",
});
return false;
}
this.globalData.settledInfo = res.data;
if (!res.data) {
return;
}
if (typeof callBack == "function") {
callBack(vm, res.data);
}
uni.hideLoading();
return res.data;
async getBaseInfo(vm, callBack) {
uni.showLoading({
title: "加载中……",
});
const res = await vm.$u.api.getSettleBaseInfo();
if (res.code !== 200) {
uni.showToast({
title: (res && res.message) || "获取基本信息错误",
icon: "none",
});
return false;
}
vm.$u.vuex('vuex_settled', res.data && res.data.record || null);
if (!res.data) {
return;
}
if (typeof callBack == "function") {
callBack(vm, res.data);
}
uni.hideLoading();
return res.data;
},
/**
......
......@@ -10,6 +10,7 @@ import {
import {learnApiFun} from "@/common/api/learn.js";
import { orderApiFun } from "@/common/api/order.js";
import {assessmentApiFun} from"@/common/api/assessment.js"
import {certApiFun} from"@/common/api/cert.js"
let apiFun = function(vm) {
let commonApi = commonApiFun(vm);
let settledApi = settledApiFun(vm)
......@@ -17,13 +18,15 @@ let apiFun = function(vm) {
let learnApi=learnApiFun(vm)
let assessmentApi = assessmentApiFun(vm)
let orderApi=orderApiFun(vm)
let certApi=certApiFun(vm)
let apiUrl = {
...commonApi,
...settledApi,
...cloudApi,
...learnApi,
...orderApi,
...assessmentApi
...assessmentApi,
...certApi
}
return apiUrl
}
......
......@@ -41,6 +41,11 @@ let settledApiFun = function(vm){
/* 获取消息内容列表 */
let listByNotice = async (params = {}) => await vm.$u.get(ucenterApiUrl+'/v1/notice/home-list', params);
/**
* 我的-更新收货地址
*/
let syncAddress = async (params = {}) => await vm.$u.post(ucenterApiUrl+'/v1/settled/sync-address', params);
const settledApi = {
getSettleBaseInfo,
getSettleArea,
......@@ -56,6 +61,7 @@ let settledApiFun = function(vm){
listOrderingTutorials,
saveCourseRate,
listByNotice,
syncAddress,
}
return settledApi
}
......
......@@ -93,7 +93,10 @@ const install = (Vue, vm) => {
message:msg
};
case 401:
// token失效,跳转登录
// token失效,清空登录信息,同时跳转登录
vm.$u.vuex('vuex_token', '');
vm.$u.vuex('vuex_user', null);
vm.$u.vuex('vuex_wx_uid', '');
toLoginPage()
case 403://没有权限访问
case 500:
......
......@@ -64,5 +64,7 @@
}
.input-item{
background: #F4F5F7;
border-radius: 12rpx;
padding-left: 20rpx;
}
</style>
......@@ -15,7 +15,7 @@
<script>
import qiniup from '@/components/upload/qiniup';
const app = getApp()
export default {
export default {
props: {},
mixins: [qiniup],
data() {
......@@ -28,12 +28,12 @@
files: [],
keys: [],
token: '',
product: '',
product: '',
allImages: []
}
},
created(e) {
// 获取照片选项对象
// 获取照片选项对象
console.log(getApp().globalData.photo.currentItem)
const product = app.globalData.photo.product
this.product = `?brandId=${product.brandId}&brand=${product.brandName}&classifyId=${product.classifyId}&systemId=${product.systemId}`
......@@ -62,7 +62,7 @@
return
}
let path = ''
if(photo.tempPath.origin && photo.waterSetting && photo.waterSetting.has_origin){
if(photo.tempPath.origin){
// 保存原图到本地
path = photo.tempPath.origin
let result = await this.saveLocal(path)
......@@ -72,11 +72,11 @@
title: '已将照片原图保存到本地相册'
})
}
}
if(photo.currentItem){
photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
}
// if(photo.currentItem){
// photo.currentItem.imageList.unshift(photo.tempPath.mixWater)
// }
// if(photo.productList && photo.productList[photo.topIndex]){
// const topArr = photo.productList[photo.topIndex]
// if(topArr[photo.itemIndex]){
......@@ -117,37 +117,37 @@
},
// 重拍图片
remakePhoto() {
remakePhoto() {
this.$emit('changeType', 1)
},
finishPhoto(){
const photo = getApp().globalData.photo
photo.currentItemLength = 10
this.continuePhoto()
// 完成本项
this.continuePhoto()
// 完成本项
//this.$emit('finish')
},
// 确认图片
continuePhoto() {
continuePhoto() {
const photo = getApp().globalData.photo
let self = this
uni.showLoading({
title:'图片保存中…'
})
self.saveTempToLocal()
self.saveTempToLocal()
self.confirmUpload(true)
},
submitFile() {
const photo = getApp().globalData.photo
if (photo.currentItemLength < 10) photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading()
// 当前项的图片显示
// 拍照项张数目增加 等于10张
photo.allImages.unshift(this.fileMaps[0])
if(photo.currentItemLength<10){
this.$emit('changeType', 1)
}else{
this.$emit('finish')
submitFile() {
const photo = getApp().globalData.photo
if (photo.currentItemLength < 10) photo.currentItemLength = photo.currentItemLength + 1
uni.hideLoading()
// 当前项的图片显示
// 拍照项张数目增加 等于10张
photo.allImages.unshift(this.fileMaps[0])
if(photo.currentItemLength<10){
this.$emit('changeType', 1)
}else{
this.$emit('finish')
}
},
downloadImages() {
......@@ -198,7 +198,7 @@
}
.bottomView {
box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05);
//box-shadow: 0 0 1rpx 6rpx rgba(255,255,255,0.05);
background-color: #333333;
width: 100%;
padding:70rpx 0;
......
......@@ -139,14 +139,6 @@
{
"root": "pages/mine",
"pages": [
{
"path":"contract/index",
"style":{
"navigationBarTitleText":"",
"enablePullDownRefresh":false,
"navigationStyle":"custom"//隐藏系统导航栏
}
},
{
"path": "address/index",
"style": {
......@@ -164,8 +156,40 @@
"navigationStyle": "custom", // 隐藏系统导航栏
"disableScroll": true
}
}
]
},
{
"path": "wallet/index",
"style": {
"navigationBarTitleText": "我的钱包",
"enablePullDownRefresh": false,
"disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏
"navigationBarBackgroundColor":"#F4F5F7"
}
},
{
"path": "cert/index",
"style": {
"navigationBarTitleText": "我的证件",
"navigationStyle":"custom"
}
},
{
"path": "cert/detail",
"style": {
"navigationBarTitleText": "",//证件详情
"navigationStyle":"custom"
}
},
{
"path": "customer/index",
"style": {
"navigationStyle":"custom",
"navigationBarTitleText": "联系客服",
"enablePullDownRefresh": false
}
}
]
},
{
"root": "pages/order",
......@@ -395,16 +419,6 @@
"condition": { //模式配置,仅开发期间生效
"current": 0, //当前激活的模式(list 的索引项)
"list": [
{
"name": "自营平台", //模式名称
"path": "pages/index/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "订单列表", //模式名称
"path": "pages/index/order", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "拍照小工具", //模式名称
"path": "pages/photo/index", //启动页面,必选
......@@ -416,11 +430,6 @@
"path": "pages/order/feedback",
"query": ""
},
{
"name": "订单详情", //模式名称
"path": "pages/order/detail", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "在线考试", //模式名称
"path": "pages/learn/exam", //启动页面,必选
......@@ -438,36 +447,16 @@
"id":11880091
} //启动参数,在页面的onLoad函数里面得到
},
{
"name": "资料信息", //模式名称
"path": "pages/settle/file", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "缴纳保证金", //模式名称
"path": "pages/settle/pay-ensure", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "签约页面", //模式名称
"path": "pages/settle/sign-contract", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "订单 - 拒单", //模式名称
"path": "pages/order/refuse", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "订单 - 过程反馈", //模式名称
"path": "pages/order/feedback", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
},
{
"name": "学习 - 首页", //模式名称
"path": "pages/index/learn", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}
},
{
"name": "我的 - 我的证件 - 列表", //模式名称
"path": "pages/mine/cert/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到
}
]
}
}
\ No newline at end of file
......@@ -106,10 +106,10 @@
};
},
watch: {
vuex_token(val, oldVal) {
// 监听token变化,如果更新则重新加载页面数据
val && this.initSettleInfo()
}
// vuex_token(val, oldVal) {
// // 监听token变化,如果更新则重新加载页面数据
// val && this.initSettleInfo()
// }
},
computed: {
buttonStyle() {
......
......@@ -123,7 +123,7 @@
return process.uniEnv.qn_base_url
},
pages() {
return ['', '', 'contract', '', 'address', '', '']
return ['wallet', '', 'contract', 'cert', 'address', '', 'customer']
},
headImageUrl() {
return this.info.headImage || this.placeholderImage
......
<template>
<view class="wrap">
<w-navbar :title="title"></w-navbar>
<view class="top">
<view class="item">
<view class="left">收货人</view>
<input type="text" placeholder-class="line" placeholder="请填写收货人姓名" />
<view class="left">姓名</view>
<input disabled v-model="name" type="text" placeholder-class="line" placeholder="请填写姓名" />
</view>
<view class="item">
<view class="left">手机号码</view>
<input type="text" placeholder-class="line" placeholder="请填写收货人手机号" />
</view>
<view class="item" @tap="showRegionPicker">
<view class="left">所在地区</view>
<input disabled type="text" placeholder-class="line" placeholder="省市区县、乡镇等" />
</view>
<view class="item address">
<view class="left">详细地址</view>
<textarea type="text" placeholder-class="line" placeholder="街道、楼牌等" />
<view class="left">电话</view>
<input disabled v-model="mobile" type="text" placeholder-class="line" placeholder="请填写电话" />
</view>
<u-field
v-model="address"
label="地址"
label-width="88"
type="textarea"
:border-bottom="false"
placeholder="请填写地址">
<view slot="right" class="right" @tap="autoLocation">
<u-icon name="map" color="#2272FF" size="30"></u-icon>
<text>自动定位</text>
</view>
</u-field>
<!-- <view class="site-clipboard">
<textarea placeholder-class="line" value="" placeholder="粘贴文本,可自动识别姓名和地址等" />
<view class="clipboard">
......@@ -26,38 +31,161 @@
</view> -->
</view>
<view class="bottom">
<view class="tag">
<view class="left">标签</view>
<view class="right">
<text class="tags"></text>
<text class="tags">公司</text>
<text class="tags">学校</text>
<view class="tags plus"><u-icon size="22" name="plus"></u-icon></view>
</view>
</view>
<view class="default">
<button class="btn, bottom-btn" @click="show = true">
<text class="button-text">保存</text>
</button>
<!-- <view class="default">
<view class="left">
<view class="set">设置默认地址</view>
<view class="tips">提醒:每次下单会默认推荐该地址</view>
</view>
<view class="right"><switch color="red" @change="setDefault" /></view>
</view>
</view> -->
</view>
<u-picker mode="region" ref="uPicker" v-model="show" />
<u-popup
border-radius="12"
width="690"
height="520"
v-model="show"
mode="center">
<view class="save-pop">
<view class="header">确认保存信息</view>
<view class="content">
<view class="tips">您填写的信息尚未保存,是否保存</view>
</view>
</view>
<view class="pop-bottom">
<button class="plain" @click="show = false" shape="circle" :plain="true">不保存</button>
<button
class="solid"
shape="circle"
@click="$u.throttle(submitForm, 500)"
:loading="submiting"
:disabled="disabledSubmit">保存</button>
</view>
</u-popup>
</view>
</template>
<script>
let r = require("libs/bmap-wx.min.js");
let h = new r.BMapWX({
// ak: "rpVq5d3yxaRCoKzVwmFMo0o4iC524CAG",
ak: "lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI"
});
export default {
data() {
return {
show: false
title: '新增地址',
show: false,
type: '充电桩安装',
name: '',
mobile: '',
address: '',
location: '',
};
},
async onLoad(e) {
if(e && e.title) {
this.title = decodeURIComponent(e.title)
}
if(this.vuex_token && this.vuex_settled) {
const settled = this.vuex_settled
this.name = settled.id_card_name || settled.nickname || settled.name || '--'
this.mobile = settled.mobile
this.address = settled.address
this.type = settled.type
} else {
this.$u.route({
type: 'redirect',
url: "pages/mine/address/index",
params: {
sync: true
}
})
}
await this.setDefault()
},
methods: {
setDefault() {},
showRegionPicker() {
this.show = true;
async setDefault() {
this.initLocation()
},
/**
* 初始化位置
*/
initLocation() {
const self = this
uni.getLocation({
type: 'wgs84',
success: function(res) {
self.baiduLocation(res.longitude, res.latitude)
}
});
},
/**
* 百度定位
* @param {Object} long
* @param {Object} lat
*/
baiduLocation(long, lat) {
let self = this,
t = function() {
let t = {
success: function(res) {
let e = res.wxMarkerData[0];
let i = e.address;
self.location = i
},
fail: function(error) {
// n.error(a), console.log(a);
}
};
if (lat && long) {
let e = lat + "," + long
// let e = "113.88308" + ',' + "22.55329"
// let e = "22.55329" + ',' + "113.88308"
t.location = e;
}
h.regeocoding(t);
};
t()
},
/**
* 自动定位
*/
autoLocation() {
let that = this
uni.chooseLocation({
success: function(res) {
that.address = res.address + res.name
},
fail: function(res) {
// uni.showToast({
// title: '定位失败'
// })
}
});
},
async submitForm() {
let self = this
let params = {
type: self.type,
address: self.address
}
let res = await self.$u.api.syncAddress(params)
if(res && res.code == 200) {
self.$u.route({
type: 'redirect',
url: "pages/mine/address/index",
params: {
sync: true
}
})
}
}
}
};
......@@ -69,25 +197,49 @@ export default {
font-size: 28rpx;
}
.wrap {
background-color: #f2f2f2;
background-color: #FFFFFF;
width: 750rpx;
height: 100vh;
.top {
background-color: #ffffff;
border-top: solid 2rpx $u-border-color;
padding: 22rpx;
padding: 10rpx 30rpx 0 30rpx;
.item {
display: flex;
font-size: 32rpx;
line-height: 100rpx;
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 88rpx;
align-items: center;
border-bottom: solid 2rpx $u-border-color;
.left {
width: 180rpx;
width: 88rpx;
color: #999999;
}
input {
text-align: left;
}
}
/deep/ .u-field {
padding: 24rpx 0;
border-bottom: solid 2rpx $u-border-color;
.u-label-text {
font-weight: 400;
color: #999999;
}
textarea {
line-height: 40rpx;
}
.u-button-wrap {
align-self: flex-start;
margin-left: 42rpx;
}
.right {
font-size: 24rpx;
font-weight: 400;
color: #2272FF;
line-height: 40rpx;
}
}
.address {
padding: 20rpx 0;
textarea {
......@@ -124,38 +276,10 @@ export default {
}
}
.bottom {
margin-top: 20rpx;
padding: 40rpx;
padding-right: 0;
margin-top: 160rpx;
padding: 0 40rpx;
background-color: #ffffff;
font-size: 28rpx;
.tag {
display: flex;
.left {
width: 160rpx;
}
.right {
display: flex;
flex-wrap: wrap;
.tags {
width: 140rpx;
padding: 16rpx 8rpx;
border: solid 2rpx $u-border-color;
text-align: center;
border-radius: 50rpx;
margin: 0 10rpx 20rpx;
display: flex;
font-size: 28rpx;
align-items: center;
justify-content: center;
color: $u-content-color;
line-height: 1;
}
.plus {
//padding: 10rpx 0;
}
}
}
.default {
margin-top: 50rpx;
display: flex;
......@@ -169,5 +293,65 @@ export default {
}
}
}
.save-pop {
padding: 0 30rpx;
.header {
text-align: center;
font-size: 40rpx;
font-weight: bold;
color: #333333;
border-bottom: solid 2rpx #F4F5F7;
line-height: 40rpx;
padding: 60rpx 0 40rpx 0;
}
.content {
margin-top: 80rpx;
margin-bottom: 116rpx;
.tips {
text-align: center;
font-size: 28rpx;
font-weight: 400;
color: #999999;
line-height: 28rpx;
}
}
}
/deep/ .pop-bottom {
padding: 0 16rpx;
margin-top: 0;
display: flex;
justify-content: space-between;
button {
width: 300rpx;
height: 104rpx;
border-radius: 52rpx;
padding: 0;
}
.plain {
border: 2px solid #2272FF;
color: #2272FF;
}
.solid {
color: #FFFFFF;
background-color: #2272FF;
}
}
}
.btn {
padding: 30rpx;
border-radius: 52rpx;
line-height: 44rpx;
font-size: 32rpx;
text-align: center;
background-color: #2272ff;
color: #fff;
&::after {
content: '';
height: 0;
border: none;
}
}
</style>
<template>
<view class="address-wrap">
<w-navbar title="收货地址"></w-navbar>
<view class="item" v-for="(res, sindex) in siteList" :key="res.id">
<view class="item">
<view class="top">
<view class="name">{{ res.name }}</view>
<view class="phone">{{ res.phone }}</view>
<view class="name">{{ settledInfo.id_card_name || settledInfo.nickname || settledInfo.name || '--' }}</view>
<view class="phone">{{ settledInfo.mobile }}</view>
</view>
<view class="bottom">
<view class="address">广东省深圳市宝安区宝城67区留芳路6号庭威产业园3栋10C</view>
<u-icon :name="editPen" :size="32" color="#999999"></u-icon>
<view class="address">{{ settledInfo.address }}</view>
<u-icon :name="editPen" :size="32" color="#999999" @tap="toAddSite('修改地址')"></u-icon>
</view>
<view class="default" v-show="true">
<u-icon name="checkmark-circle" color="#2272FF" size="32"></u-icon>
<text class="txt">默认地址</text>
</view>
</view>
<view class="addSite" @tap="toAddSite">
<!-- <view class="addSite" @tap="toAddSite('新增地址')">
<view class="add">
<u-icon name="plus" color="#ffffff" class="icon" :size="30"></u-icon>新建收货地址
</view>
</view>
</view> -->
</view>
</template>
<script>
const app = getApp();
export default {
data() {
return {
background: {
backgroundColor: 'none'
},
settledInfo: null,
siteList: []
};
},
onLoad() {
this.getData();
onLoad(e) {
if(e && e.sync) {
this.getData();
} else {
if(this.vuex_token && this.vuex_settled) {
this.settledInfo = this.vuex_settled
} else {
this.getData();
}
}
},
computed: {
editPen() {
......@@ -43,45 +53,23 @@ export default {
},
methods: {
getData() {
this.siteList = [
{
id: 1,
name: '游X',
phone: '183****5523',
tag: [
{
tagText: '默认'
},
{
tagText: '家'
}
],
site: '广东省深圳市宝安区宝城67区留芳路6号庭威产业园3栋10C'
},
{
id: 2,
name: '李XX',
phone: '183****5555',
tag: [
{
tagText: '公司'
}
],
site: '广东省深圳市宝安区 翻身路xx号'
},
{
id: 3,
name: '王YY',
phone: '153****5555',
tag: [],
site: '广东省深圳市宝安区 平安路13号'
let self = this
const callBack = (vm, result) => {
// 后台自动判断入驻流程是否完成,前台通过status确定状态
if (result && result.record) {
self.settledInfo = result.record
}
];
};
app.getBaseInfo(self, callBack);
},
toAddSite(){
uni.navigateTo({
url: '/pages/mine/address/addSite'
});
toAddSite(title){
this.$u.route({
type: 'redirect',
url: 'pages/mine/address/addSite',
params: {
title: title
}
})
}
}
};
......
......@@ -49,7 +49,7 @@
@value-change="fieldValueChange">
</xh-select>
<xh-files v-else-if="typeToComponentType(item.fieldsType)==='file'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :value='form[item.fieldsName] || []'
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || []'
@value-change="fieldValueChange">
</xh-files>
<xh-location v-else-if="typeToComponentType(item.fieldsType)==='location'"
......
......@@ -35,7 +35,7 @@ const store = new Vuex.Store({
vuex_version: '1.0.1',
vuex_config: {},
// 入驻信息
vuex_settled: {},
vuex_settled: null,
vuex_wx_uid: lifeData.vuex_wx_uid || 0,
},
mutations: {
......
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