Merge remote-tracking branch 'origin/master'

This commit is contained in:
cun-nan 2023-12-01 15:41:09 +08:00
commit 1a43fc6480
8 changed files with 337 additions and 131 deletions

View File

@ -7,21 +7,22 @@
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="box-xianze">
<view class="box-left">
<view class="box-xianze" v-for="(item,index) in dataList" :key="index">
<view class="box-left" @click="choose(item)">
<view style="display: flex;align-items: center;margin-bottom: 5px;">
<view class="tapl">默认</view>
<view class="">具体的详细地址</view>
<view v-if="item.ifDefault == 1" class="tapl">默认</view>
<view class="">{{item.address}}</view>
</view>
<view style="display: flex;align-items: center; font-size: 14px; color: #666666;">
<view class=""> 用户姓名</view>
<view class=""> 186549451154</view>
<view class=""> {{item.name}}</view>
<view class=""> {{item.mobile}}</view>
</view>
</view>
<view class="box-right">
<view class="box-right" @click="goedit(item)">
<u-icon name="edit-pen-fill" size="22"></u-icon>
</view>
</view>
<view class="bottom-anniu" @click="goedit()">
<view class="">新增收货地址</view>
</view>
@ -31,24 +32,54 @@
</template>
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
title: '',
dataList: '',
}
},
onShow() {
this.getList();
},
components: {
},
methods: {
goedit() {
getList() {
request({
url: 'business/userManager/mtUserExpressAddress/getList',
method: 'get',
}).then((res) => {
if (res.code == 200) {
this.dataList = res.data
}
})
},
goedit(data) {
if (data != null) {
console.log(data)
//
uni.$on('unAddressInfo', function() {
uni.$emit('addressInfo', data)
})
}
uni.navigateTo({
url: '/pagesHome/editress/editress'
})
},
choose(data) {
//
uni.$on('unChooseAddr', function() {
uni.$emit('chooseAddr', data)
})
uni.navigateBack()
},
goback() {
uni.navigateBack()
}

View File

@ -10,7 +10,7 @@
<!-- 顶部区域 -->
<view class="top-lanmu">
<view style="width: 90%;margin: 0 auto;">
<view class="title-bai">0</view>
<view class="title-bai">{{myPoints}}</view>
<view class="size-bai">
<uni-icons type="location" color="#ffffff" size="16"></uni-icons>
<text>蓝鲸加油站总站</text>
@ -103,6 +103,7 @@
export default {
data() {
return {
myPoints: 0,
categoryList: {},
integralGiftList: {},
title: '',
@ -126,6 +127,9 @@
this.getCategoryList();
this.getIntegralGiftList();
},
onShow() {
this.getUserInfoList()
},
methods: {
transferIndex(index, categoryId) {
this.qhindex = index
@ -160,7 +164,7 @@
}
})
},
//
gojg(nmb) {
if (nmb == 1) {
uni.navigateTo({
@ -200,7 +204,19 @@
},
goback() {
uni.navigateBack()
}
},
//
getUserInfoList() {
request({
url: '/business/userManager/user/getByUniApp',
method: 'get',
// params:{}
}).then((res) => {
if (res.code == 200) {
this.myPoints = res.data.points
}
})
},
},
onUnload() {
uni.$off('goodsInfo')

View File

@ -1,65 +1,76 @@
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">编辑收货地址</view>
<view class="my-text">收获信息</view>
<view class="my-icons"></view>
</view>
<view class="dataform">
<u-form :model="dataForm" ref="uForm">
<u-form-item label="姓名"><u-input v-model="dataForm.name" /></u-form-item>
</u-form>
</view>
<!-- <view class="box-gang">
<view class="box-gang">
<view class="g-name">联系人</view>
<input type="text" placeholder="请填写收货人" v-model='name' />
<input type="text" placeholder="请填写收货人" v-model='dataForm.name' />
</view>
<view class="box-gang">
<view class="g-name">手机号</view>
<input type="text" placeholder="请填写手机号" v-model='mobile' />
<input type="text" placeholder="请填写手机号" v-model='dataForm.mobile' />
</view>
<view class="box-gang">
<view class="g-name">所在地区</view>
<input type="text" placeholder="请填写所在地区" v-model='address' />
<input type="text" placeholder="请填写所在地区" v-model='dataForm.address' />
</view>
<view class="box-gang">
<view class="g-name">详细地区</view>
<input type="text" placeholder="请填写详细地区" v-model='fullAddress' />
<input type="text" placeholder="请填写详细地区" v-model='dataForm.fullAddress' />
</view>
<view class="box-gang-bt">
<view class="g-name">默认地址</view>
<u-switch v-model="value" @change="change"></u-switch>
</view> -->
</view>
<!-- 顶部区域 -->
<!--
<view class="bottom-anniu" @click="goedit()">
<view class="">提交</view>
</view> -->
</view>
</view>
</view>
</template>
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
title: '',
value: true,
dataForm: {
id: null,
name: '',
mobile: '',
address: '',
ifDfault: '',
ifDefault: '',
fullAddress: '',
}
}
},
onLoad() {
uni.$on('addressInfo', (data) => {
if (data != null) {
this.dataForm = data
if (this.dataForm.ifDefault == 1) {
this.value = true
} else {
this.value = false
}
}
})
uni.$emit('unAddressInfo')
},
components: {
},
@ -71,6 +82,42 @@
uni.navigateBack()
},
goedit() {
if (this.value) {
this.dataForm.ifDefault = 1
} else {
this.dataForm.ifDefault = 2
}
let url = 'business/userManager/mtUserExpressAddress'
if (this.dataForm.id != null) {
request({
url: url,
method: 'put',
data: this.dataForm
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '修改成功',
icon: 'none'
}),
uni.navigateBack()
}
})
} else {
request({
url: url,
method: 'post',
data: this.dataForm
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '提交成功',
icon: 'none'
}),
uni.navigateBack()
}
})
}
console.log("123123", this.dataForm)
}
}
@ -136,7 +183,9 @@
}
.dataform {
margin: 20px auto;
background-color: #ffffff;
margin: 20px 20px 20px 20px;
}

View File

@ -60,6 +60,9 @@
},
onLoad() {
},
onShow() {
uni.$on('goodsInfo', (data) => {
this.goodsInfo = data
if (this.goodsInfo != null) {
@ -67,8 +70,6 @@
}
})
uni.$emit('un')
},
@ -76,6 +77,7 @@
change() {},
click() {},
dataProcessing() {
this.giftImages = []
if (this.goodsInfo.giftImages != null && this.goodsInfo.giftImages != undefined) {
const myGiftImages = JSON.parse(this.goodsInfo.giftImages);
myGiftImages.forEach(res => {

View File

@ -38,7 +38,8 @@
<view class="">
<view class="">家庭住址</view>
<view class="hui-time">
山东省济南市槐荫区兴福路
<!-- 山东省济南市槐荫区兴福路 -->
{{addrInfo.address}}
</view>
</view>
@ -74,7 +75,10 @@
</view>
<view class="endbox">
<view style="color: #666666;font-size: 14px;">{{value}}件商品合计:</view>
<view style="color: red;"> <text style="font-weight: bold;font-size: 20px;">140.00</text> 积分</view>
<view style="color: red;"> <text style="font-weight: bold;font-size: 20px;">{{allPoints}}</text> 积分
</view>
<view style="color: red;"> <text style="font-weight: bold;font-size: 20px;">+{{allAmout}}</text>
</view>
</view>
</view>
@ -85,8 +89,11 @@
</view>
<view class="bottom-box">
<view class="">
<view style="color: red;"> <text style="font-weight: bold;font-size: 20px;">140.00</text> 积分</view>
<view style="color: #9d9d9d; font-size: 12px; ">积分账户0.00</view>
<view style="color: red;">
<text style="font-weight: bold;font-size: 20px;">{{allPoints}}</text> 积分
<text style="font-weight: bold;font-size: 20px;">+{{allAmout}}</text>
</view>
<view style="color: #9d9d9d; font-size: 12px; ">积分账户{{myPoints}}</view>
</view>
<view class="andeniu">
<text>选择</text>
@ -106,11 +113,17 @@
data() {
return {
myPoints: 0, //
goodsInfo: '',
title: '',
qhindex: 0,
value: 1,
baseUrl: config.baseUrl,
allPoints: 0,
allAmout: 0,
addrInfo: {
address: '请填写地址'
},
tapList: [{
text: '到店自提'
@ -131,9 +144,25 @@
this.goodsInfo = data
if (this.goodsInfo != null) {
this.dataProcessing()
this.allData()
}
})
uni.$emit('un')
},
onShow() {
uni.$on('chooseAddr', (data) => {
this.addrInfo = data
})
uni.$emit('unChooseAddr')
if (this.addrInfo == '' || this.addrInfo == null) {
this.getAddr()
}
//
this.getUserInfoList()
},
@ -142,16 +171,13 @@
methods: {
dataProcessing() {
if (this.goodsInfo.deliveryMethod != null && this.goodsInfo.deliveryMethod != undefined) {
const deliveryData = JSON.parse(this.goodsInfo.deliveryMethod);
this.deliveryMethod = deliveryData.join('+');
} else {
this.deliveryMethod = '无配送信息'
}
},
valChange(e) {
console.log('当前值为: ' + e.value)
@ -166,7 +192,65 @@
},
goback() {
uni.navigateBack()
}
},
//
allData() {
console.log("hhhhhhhhhhhhhhhhhhhhhhhhh")
this.allPoints = 0
this.allAmout = 0
let allPoints = new BigNumber(this.allPoints)
let allAmout = new BigNumber(this.allAmout)
//
if (this.value < 1) {
this.value = 1
}
let value = new BigNumber(this.value)
allPoints.times(value)
if (this.goodsInfo.exchangeMethod == '积分+金额') {
allPoints.times(value)
}
//
this.allPoints = Number(allPoints).toFixed(2);
this.allAmout = Number(allAmout).toFixed(2);
},
getAddr() {
request({
url: 'business/userManager/mtUserExpressAddress/getList',
method: 'get',
}).then((res) => {
if (res.code == 200) {
console.log("res", res.data)
if (res.data.length > 0) {
this.addrInfo = res.data[0]
} else {
this.addrInfo.address = '请填写地址'
}
}
})
},
//
getUserInfoList() {
request({
url: '/business/userManager/user/getByUniApp',
method: 'get',
// params:{}
}).then((res) => {
if (res.code == 200) {
this.myPoints = res.data.points
}
})
},
}
}
</script>

View File

@ -2,7 +2,7 @@
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" > </view>
<view class="my-icons"> </view>
<view class="my-text"></view>
<view class="my-icons"></view>
</view>
@ -10,7 +10,7 @@
<!-- 顶部区域 -->
<button class="dl-box" open-type='getPhoneNumber' @getphonenumber="getPhone">手机号快捷登录</button>
<button class="kk-box" @click="goback" >我再看看</button>
<button class="kk-box" @click="goback">我再看看</button>
<view class="dbottom">
<view class="quanzi" v-if="qindex == false " @click="qindex =! qindex"></view>
<view class="lanquanzi" v-if="qindex == true" @click="qindex =! qindex"><u-icon name="checkbox-mark"
@ -37,11 +37,9 @@
console.log(this.$baseUrl);
},
components: {
},
components: {},
methods: {
wxlogin() {
},
wxlogin() {},
getPhone(e) {
let that = this
// if (this.privacyPolicyChecked == false) {
@ -75,7 +73,7 @@
userInfo: {
storeId: 0,
staffId: "",
phone:'17753808121'
phone: '17753808121'
},
type: 'phone',
@ -86,11 +84,15 @@
success: (rex) => {
console.log('请求成功', rex)
if (rex.data.code == 200) {
uni.setStorageSync('App-Token', rex.data.data.token);
uni.setStorageSync('App-Token', rex.data.data
.token);
uni.navigateTo({
url: '/pages/index/index'
})
}
console.log("swq",uni.getStorageSync('App-Token'));
console.log("swq", uni.getStorageSync(
'App-Token'));
},
fail: (res) => {
console.log("fail", res);
@ -154,14 +156,16 @@
position: fixed;
top: 0px;
}
.dl{
.dl {
height: 40px;
background: #2F72F7;
border-radius: 50px;
}
.top-box{
.top-box {
width: 100%;
height: 60vh;
background: url('http://47.95.206.185:83/lgoin.png')center no-repeat;
@ -169,14 +173,16 @@
background-attachment: fixed;
}
.dl-box{
.dl-box {
width: 80%;
height: 45px;
background: #2F72F7;
color: white;
border-radius: 50px;
}
.kk-box{
.kk-box {
width: 80%;
height: 45px;
background: #F0F3FA;
@ -185,6 +191,7 @@
border: 1px solid #F0F3FA;
margin: 10px auto;
}
.dbottom {
width: 100%;
text-align: center;
@ -263,4 +270,4 @@
border: 1px solid #0078FF;
color: white;
}
</style>
</style>

View File

@ -12,10 +12,10 @@
<view class="b-box">
<view class="">
<view class="hui-size">我的积分</view>
<view class="lan-num">0</view>
<view class="lan-num">{{myPoints}}</view>
</view>
<view class="anniu">
积分上传
<view class="anniu" @click="login">
积分签到
</view>
</view>
</view>
@ -50,35 +50,42 @@
data() {
return {
title: '',
myPoints:0, //
myPoints: 0, //
}
},
components: {
},
onShow() {
this.getUserInfoList();
},
methods: {
//
getUserInfoList(){
getUserInfoList() {
request({
url: '/business/userManager/user/name/'+1,
url: '/business/userManager/user/getByUniApp',
method: 'get',
// params:{}
}).then((res)=>{
if(res.code == 200){
console.log("hello world",res)
}).then((res) => {
if (res.code == 200) {
this.myPoints = res.data.points
}
})
},
//
comeOn () {},
comeOn() {},
//
recharge () {},
recharge() {},
goback() {
uni.navigateBack()
},
//
login() {
}
}
}

View File

@ -1,71 +1,81 @@
import store from '@/store'
import config from '@/config'
import { getToken } from '@/utils/auth'
import {
getToken
} from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import { toast, showConfirm, tansParams } from '@/utils/common'
import {
toast,
showConfirm,
tansParams
} from '@/utils/common'
let timeout = 10000
const baseUrl = config.baseUrl
const request = config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
if (getToken() && !isToken) {
// config.header['Authorization'] = getToken()
config.header['Access-Token'] = getToken()
}
// get请求映射params参数
if (config.params) {
let url = config.url + '?' + tansParams(config.params)
url = url.slice(0, -1)
config.url = url
}
return new Promise((resolve, reject) => {
uni.request({
method: config.method || 'get',
timeout: config.timeout || timeout,
url: config.baseUrl || baseUrl + config.url,
data: config.data,
header: config.header,
dataType: 'json'
}).then(response => {
// debugger
let res = response
const code = res.data.code || 200
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
store.dispatch('LogOut').then(res => {
uni.reLaunch({ url: '/pages/login/login' })
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
toast(msg)
reject('500')
} else if (code !== 200) {
toast(msg)
reject(code)
}
resolve(res.data)
})
.catch(error => {
let { message } = error
if (message === 'Network Error') {
message = '后端接口连接异常'
} else if (message.includes('timeout')) {
message = '系统接口请求超时'
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
toast(message)
reject(error)
})
})
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
if (getToken() && !isToken) {
// config.header['Authorization'] = getToken()
config.header['Access-Token'] = getToken()
}
// get请求映射params参数
if (config.params) {
let url = config.url + '?' + tansParams(config.params)
url = url.slice(0, -1)
config.url = url
}
return new Promise((resolve, reject) => {
uni.request({
method: config.method || 'get',
timeout: config.timeout || timeout,
url: config.baseUrl || baseUrl + config.url,
data: config.data,
header: config.header,
dataType: 'json'
}).then(response => {
// debugger
let res = response
const code = res.data.code || 200
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
store.dispatch('LogOut').then(res => {
uni.reLaunch({
url: 'pagesLogin/login/login'
})
})
}
})
reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
toast(msg)
reject('500')
} else if (code !== 200) {
toast(msg)
reject(code)
}
resolve(res.data)
})
.catch(error => {
let {
message
} = error
if (message === 'Network Error') {
message = '后端接口连接异常'
} else if (message.includes('timeout')) {
message = '系统接口请求超时'
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
toast(message)
reject(error)
})
})
}
export default request
export default request