会员信息
This commit is contained in:
parent
c9dbe51f22
commit
323add1517
@ -14,7 +14,11 @@ public class ReturnParameter {
|
|||||||
*/
|
*/
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
/**
|
/**
|
||||||
* 响应报文
|
* 调起微信支付所需参数(json形式的字符串)
|
||||||
*/
|
*/
|
||||||
private String reservedPayInfo;
|
private String reservedPayInfo;
|
||||||
|
/**
|
||||||
|
* 调起支付宝支付所需参数
|
||||||
|
*/
|
||||||
|
private String reservedTransactionId;
|
||||||
}
|
}
|
||||||
|
@ -384,6 +384,7 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
ReturnParameter returnParameter = new ReturnParameter();
|
ReturnParameter returnParameter = new ReturnParameter();
|
||||||
returnParameter.setOrderNo(receiveParameter.getOrderNo());
|
returnParameter.setOrderNo(receiveParameter.getOrderNo());
|
||||||
returnParameter.setReservedPayInfo(resMap.get("reserved_pay_info"));
|
returnParameter.setReservedPayInfo(resMap.get("reserved_pay_info"));
|
||||||
|
returnParameter.setReservedTransactionId(resMap.get("reserved_transaction_id"));
|
||||||
|
|
||||||
res.put("data",returnParameter);
|
res.put("data",returnParameter);
|
||||||
return res;
|
return res;
|
||||||
|
@ -46,10 +46,18 @@ public class LJUserController extends BaseController {
|
|||||||
return getSuccessResult(list);
|
return getSuccessResult(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录用户信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getUser")
|
||||||
|
public ResponseObject getUser(){
|
||||||
|
return getSuccessResult(userService.selectUserByUserId());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据storeId查询会员人数
|
* 根据storeId查询会员人数
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@GetMapping("/userNum")
|
@GetMapping("/userNum")
|
||||||
public ResponseObject userNum(Integer storeId){
|
public ResponseObject userNum(Integer storeId){
|
||||||
return getSuccessResult(userService.userNum(storeId));
|
return getSuccessResult(userService.userNum(storeId));
|
||||||
@ -190,4 +198,14 @@ public class LJUserController extends BaseController {
|
|||||||
public ResponseObject edit(@Validated @RequestBody LJUserVo user){
|
public ResponseObject edit(@Validated @RequestBody LJUserVo user){
|
||||||
return getSuccessResult(userService.updateUser(user));
|
return getSuccessResult(userService.updateUser(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员信息
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public ResponseObject editUser(@Validated @RequestBody LJUser user){
|
||||||
|
return getSuccessResult(userService.editUser(user));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,12 @@ public interface LJUserService extends IService<LJUser> {
|
|||||||
|
|
||||||
Integer userNum(Integer storeId);
|
Integer userNum(Integer storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当前登录的用户信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
LJUser selectUserByUserId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有会员信息
|
* 查询所有会员信息
|
||||||
* @return
|
* @return
|
||||||
@ -85,6 +91,13 @@ public interface LJUserService extends IService<LJUser> {
|
|||||||
*/
|
*/
|
||||||
public int updateUser(LJUserVo user);
|
public int updateUser(LJUserVo user);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录用户修改会员信息(自己修改)
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int editUser(LJUser user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 等级清算规则
|
* 等级清算规则
|
||||||
*/
|
*/
|
||||||
|
@ -63,6 +63,12 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
return baseMapper.selectCount(queryWrapper);
|
return baseMapper.selectCount(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LJUser selectUserByUserId() {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
return baseMapper.selectById(nowAccountInfo.getId());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有会员信息
|
* 查询所有会员信息
|
||||||
* @return
|
* @return
|
||||||
@ -311,6 +317,11 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int editUser(LJUser user) {
|
||||||
|
return baseMapper.updateById(user);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clearRule() {
|
public void clearRule() {
|
||||||
List<LJUserVo> list = this.selectUsersList();
|
List<LJUserVo> list = this.selectUsersList();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# \u57FA\u672C\u914D\u7F6E
|
# \u57FA\u672C\u914D\u7F6E
|
||||||
server.port=8008
|
server.port=8080
|
||||||
env.profile=dev
|
env.profile=dev
|
||||||
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
||||||
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
|
env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
||||||
|
|
||||||
|
|
||||||
# \u6570\u636E\u5E93\u914D\u7F6E
|
# \u6570\u636E\u5E93\u914D\u7F6E
|
||||||
|
@ -1463,7 +1463,7 @@
|
|||||||
_this.oilOrder.forEach(item => {
|
_this.oilOrder.forEach(item => {
|
||||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||||
if (item.type == "汽油") {
|
if (item.type == "汽油") {
|
||||||
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
let gasolineRule = JSON.parse(response.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||||
if (response.data.gasolineDiscount == "满减优惠") {
|
if (response.data.gasolineDiscount == "满减优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
@ -1534,7 +1534,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.type == "柴油") {
|
if (item.type == "柴油") {
|
||||||
let dieselRule = JSON.parse(response.data.dieselRule);
|
let dieselRule = JSON.parse(response.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||||
if (response.data.dieselDiscount == "满减优惠") {
|
if (response.data.dieselDiscount == "满减优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
@ -1605,7 +1605,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.type == "天然气") {
|
if (item.type == "天然气") {
|
||||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
let naturalGasRule = JSON.parse(response.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||||
if (response.data.naturalGasDiscount == "满减优惠") {
|
if (response.data.naturalGasDiscount == "满减优惠") {
|
||||||
let oilDiscount = 0;
|
let oilDiscount = 0;
|
||||||
|
@ -170,6 +170,13 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "editUser/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "修改用户信息",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "Coupons/Coupons",
|
"path": "Coupons/Coupons",
|
||||||
"style": {
|
"style": {
|
||||||
|
@ -8,11 +8,12 @@
|
|||||||
<view class="my-top">
|
<view class="my-top">
|
||||||
<view class="dis-box">
|
<view class="dis-box">
|
||||||
<view class="dis">
|
<view class="dis">
|
||||||
<view class="touxiang" @click="gosetup">
|
<view class="touxiang" @click="goSetup">
|
||||||
<image src="../../static/imgs/myx.png" mode=""></image>
|
<image v-if="user.avatar!='' && user.avatar!=null && user.avatar!=undefined" :src="baseUrl + user.avatar" mode=""></image>
|
||||||
|
<image v-else src="../../static/imgs/myx.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="user-tel">135****7106</view>
|
<view class="user-tel" @click="goSetup">{{user.mobile}}</view>
|
||||||
<view class="user-name" @click="gorefuel">蓝鲸加油站(总站)<uni-icons type="right" color="#c1c1ff"
|
<view class="user-name" @click="gorefuel">蓝鲸加油站(总站)<uni-icons type="right" color="#c1c1ff"
|
||||||
size="12"></uni-icons> </view>
|
size="12"></uni-icons> </view>
|
||||||
</view>
|
</view>
|
||||||
@ -21,12 +22,12 @@
|
|||||||
size="16"></uni-icons></view>
|
size="16"></uni-icons></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="my-top-box">
|
<view class="my-top-box">
|
||||||
<view class="jg-box" @click="gomony()">
|
<view class="jg-box" @click="goMony()">
|
||||||
<view class="jg-box-title">储值余额</view>
|
<view class="jg-box-title">储值余额</view>
|
||||||
<view class="jg-box-nmb">{{cardBalance || 0 }}元</view>
|
<view class="jg-box-nmb">{{cardBalance || 0 }}元</view>
|
||||||
</view>
|
</view>
|
||||||
<text style="color: #999999;">|</text>
|
<text style="color: #999999;">|</text>
|
||||||
<view class="jg-box" @click="gooil()">
|
<view class="jg-box" @click="goOil()">
|
||||||
<view class="jg-box-title">囤油升数</view>
|
<view class="jg-box-title">囤油升数</view>
|
||||||
<view class="jg-box-nmb">{{refuelMoney[0].refuelMoney || 0 }}升</view>
|
<view class="jg-box-nmb">{{refuelMoney[0].refuelMoney || 0 }}升</view>
|
||||||
</view>
|
</view>
|
||||||
@ -37,14 +38,14 @@
|
|||||||
<view class="jg-box-nmb">{{cardsList.length || 0 }}</view>
|
<view class="jg-box-nmb">{{cardsList.length || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<text style="color: #999999;">|</text>
|
<text style="color: #999999;">|</text>
|
||||||
<view class="jg-box" style="border: none;" @click="gointegral()">
|
<view class="jg-box" style="border: none;" @click="goIntegral()">
|
||||||
<view class="jg-box-title">我的积分</view>
|
<view class="jg-box-title">我的积分</view>
|
||||||
<view class="jg-box-nmb">{{myPoints || 0 }}</view>
|
<view class="jg-box-nmb">{{myPoints || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="my-top-box" style="margin-top: 45px;">
|
<view class="my-top-box" style="margin-top: 45px;">
|
||||||
<view class="centenr-sx" @click="gomyorder(0)">
|
<view class="centenr-sx" @click="goMyOrder(0)">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/dingdan.png" mode=""></image>
|
<image src="../../static/my/dingdan.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -54,7 +55,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="centenr-sx" @click="gomyorder(1)">
|
<view class="centenr-sx" @click="goMyOrder(1)">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/dsy.png" mode=""></image>
|
<image src="../../static/my/dsy.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -63,7 +64,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="centenr-sx" @click="gomyorder(2)">
|
<view class="centenr-sx" @click="goMyOrder(2)">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/ywc.png" mode=""></image>
|
<image src="../../static/my/ywc.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -71,7 +72,7 @@
|
|||||||
已完成
|
已完成
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="centenr-sx" @click="gomyorder(3)">
|
<view class="centenr-sx" @click="goMyOrder(3)">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/dpj.png" mode=""></image>
|
<image src="../../static/my/dpj.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -91,7 +92,7 @@
|
|||||||
礼品卡
|
礼品卡
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="centenr-sx" @click="gotodaby">
|
<view class="centenr-sx" @click="goToDaby">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/jryj.png" mode=""></image>
|
<image src="../../static/my/jryj.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -101,7 +102,7 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="centenr-sx" @click="gowriteoff()">
|
<view class="centenr-sx" @click="goWriteoff()">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/jl.png" mode=""></image>
|
<image src="../../static/my/jl.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
@ -110,7 +111,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="centenr-sx" @click="gorecharge()">
|
<view class="centenr-sx" @click="goRecharge()">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/chongzhi.png" style="width: 30px;height: 30px; "></image>
|
<image src="../../static/my/chongzhi.png" style="width: 30px;height: 30px; "></image>
|
||||||
</view>
|
</view>
|
||||||
@ -118,7 +119,7 @@
|
|||||||
充值记录
|
充值记录
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="centenr-sx" @click="goinvte()">
|
<view class="centenr-sx" @click="goInvte()">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/lp.png" style="width: 30px;height: 30px; "></image>
|
<image src="../../static/my/lp.png" style="width: 30px;height: 30px; "></image>
|
||||||
</view>
|
</view>
|
||||||
@ -134,7 +135,7 @@
|
|||||||
积分商城
|
积分商城
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="centenr-sx" @click="gocard()">
|
<view class="centenr-sx" @click="goCard()">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/kb.png"></image>
|
<image src="../../static/my/kb.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@ -142,7 +143,7 @@
|
|||||||
子卡管理
|
子卡管理
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="centenr-sx" @click="gofeedback()">
|
<view class="centenr-sx" @click="goFeedback()">
|
||||||
<view class="centenr-img">
|
<view class="centenr-img">
|
||||||
<image src="../../static/my/yj.png"></image>
|
<image src="../../static/my/yj.png"></image>
|
||||||
</view>
|
</view>
|
||||||
@ -170,7 +171,9 @@
|
|||||||
cardBalance: 0.00,
|
cardBalance: 0.00,
|
||||||
title: '',
|
title: '',
|
||||||
msg: "3",
|
msg: "3",
|
||||||
|
// url信息
|
||||||
|
baseUrl: this.$baseUrl,
|
||||||
|
user:{},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -180,10 +183,23 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.getUserBalance();
|
this.getUserBalance();
|
||||||
this.getGiftRecords();
|
this.getGiftRecords();
|
||||||
this.getUserInfoList()
|
this.getUserInfoList();
|
||||||
|
this.getUser()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
gomyorder(id) {
|
// 查询当前登录用户信息
|
||||||
|
getUser(){
|
||||||
|
request({
|
||||||
|
url: 'business/userManager/user/getUser',
|
||||||
|
method: 'get',
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data != null && res.data != "" && res.data != undefined) {
|
||||||
|
this.user = res.data
|
||||||
|
this.user.mobile = res.data.mobile.slice(0,3) + "****" + res.data.mobile.slice(res.data.mobile.length-5,res.data.mobile.length-1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goMyOrder(id) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/myorder/myorder?id=' + id
|
url: '/pagesMy/myorder/myorder?id=' + id
|
||||||
})
|
})
|
||||||
@ -193,27 +209,27 @@
|
|||||||
url: '/pagesHome/RechargeRecords/RechargeRecords'
|
url: '/pagesHome/RechargeRecords/RechargeRecords'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gotodaby() {
|
goToDaby() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/today/today'
|
url: '/pagesMy/today/today'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gointegral() {
|
goIntegral() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/integral/integral'
|
url: '/pagesMy/integral/integral'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gooil() {
|
goOil() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/oilBalance/oilBalance'
|
url: '/pagesMy/oilBalance/oilBalance'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gomony() {
|
goMony() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/moneyBalance/moneyBalance'
|
url: '/pagesMy/moneyBalance/moneyBalance'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gosetup() {
|
goSetup() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/setup/index'
|
url: '/pagesMy/setup/index'
|
||||||
})
|
})
|
||||||
@ -223,12 +239,12 @@
|
|||||||
url: '/pagesRefuel/pagesRefuel/index'
|
url: '/pagesRefuel/pagesRefuel/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gowriteoff() {
|
goWriteoff() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/writeOff/writeOff'
|
url: '/pagesMy/writeOff/writeOff'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gorecharge() {
|
goRecharge() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/Recharge/Recharge'
|
url: '/pagesMy/Recharge/Recharge'
|
||||||
})
|
})
|
||||||
@ -238,12 +254,12 @@
|
|||||||
url: '/pagesHome/PointsMall/PointsMall'
|
url: '/pagesHome/PointsMall/PointsMall'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goinvte() {
|
goInvte() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/invite/invite'
|
url: '/pagesMy/invite/invite'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gocard() {
|
goCard() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/CardManagement/CardManagement'
|
url: '/pagesMy/CardManagement/CardManagement'
|
||||||
})
|
})
|
||||||
@ -253,7 +269,7 @@
|
|||||||
url: '/pagesMy/VIP/vip'
|
url: '/pagesMy/VIP/vip'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gofeedback() {
|
goFeedback() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesMy/feedback/feedback'
|
url: '/pagesMy/feedback/feedback'
|
||||||
})
|
})
|
||||||
@ -263,7 +279,6 @@
|
|||||||
url: '/business/userManager/user/getUserBalance',
|
url: '/business/userManager/user/getUserBalance',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
// console.log(res,111222)
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.cardBalance = res.data.cardBalance,
|
this.cardBalance = res.data.cardBalance,
|
||||||
/* if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
|
/* if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
|
||||||
@ -279,7 +294,6 @@
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: this.query
|
params: this.query
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
// console.log(res)
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.cardsList = res.data.records
|
this.cardsList = res.data.records
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
<view class="box-oil2" :class=" {'xz' :sindex == index }"
|
<view class="box-oil2" :class=" {'xz' :sindex == index }"
|
||||||
v-for="(item,index) in staffList" :key="index"
|
v-for="(item,index) in staffList" :key="index"
|
||||||
@click="getSIndex(index,item.id)">
|
@click="getSIndex(index,item.id)">
|
||||||
<text>{{item.realName}}员工</text>
|
<text>{{item.realName}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<tabbar></tabbar>
|
<tabbar></tabbar>
|
||||||
@ -555,6 +555,8 @@
|
|||||||
}
|
}
|
||||||
.box-oil2 {
|
.box-oil2 {
|
||||||
width: 28%;
|
width: 28%;
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
282
gasStation-uni/pagesMy/editUser/index.vue
Normal file
282
gasStation-uni/pagesMy/editUser/index.vue
Normal file
@ -0,0 +1,282 @@
|
|||||||
|
<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">{{title}}</view>
|
||||||
|
<view class="my-icons"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 修改用户昵称 -->
|
||||||
|
<view v-if="editType == 0" class="pBox">
|
||||||
|
<u-form :model="form" ref="uForm">
|
||||||
|
<u-form-item label="昵称" prop="name">
|
||||||
|
<u-input v-model="form.name" clearable :border="false" placeholder="请填写昵称"/>
|
||||||
|
</u-form-item>
|
||||||
|
</u-form>
|
||||||
|
<view class="but-sub" @click="submit">提交保存</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 修改用户手机号 -->
|
||||||
|
<view v-if="editType == 1" class="pBox">
|
||||||
|
<u-form :model="form" ref="uForm">
|
||||||
|
<u-form-item label="手机号" prop="mobile" label-width="70px">
|
||||||
|
<u-input v-model="mobile" clearable :border="false" placeholder="请填写手机号"/>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="验证码" prop="code" label-width="70px">
|
||||||
|
<u-input v-model="code" clearable :border="false" placeholder="请填写验证码"/>
|
||||||
|
<u-button slot="right" :disabled="isCode" size="mini" type="success" @click="getCode">{{codeText}}</u-button>
|
||||||
|
</u-form-item>
|
||||||
|
</u-form>
|
||||||
|
<view class="but-sub" @click="submit">保存变更</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 修改用户车牌号 -->
|
||||||
|
<view v-if="editType == 2" class="pBox">
|
||||||
|
<view></view>
|
||||||
|
<u-form :model="form" ref="uForm">
|
||||||
|
<u-form-item label="车牌号" prop="mobile" label-width="70px">
|
||||||
|
<u-input v-model="form.carNo" @focus="show = true" clearable :border="false" placeholder="请输入车牌号"/>
|
||||||
|
</u-form-item>
|
||||||
|
</u-form>
|
||||||
|
<view class="but-sub" @click="submit">保存</view>
|
||||||
|
</view>
|
||||||
|
<!-- <u-keyboard ref="uKeyboard" :tips="value" mode="number" @cancel="show = false" @confirm="submitAmount" -->
|
||||||
|
<!-- @change="valChange" @backspace="backspace" v-model="pic" :show="show" mode="car"></u-keyboard> -->
|
||||||
|
<u-keyboard ref="uKeyboard" mode="car" v-model="value" :show="show" @cancel="show = false"
|
||||||
|
@confirm="submitAmount" @change="valChange" @backspace="backspace" :tips="value"></u-keyboard>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import request from "../../utils/request";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pic:0,
|
||||||
|
value:"",
|
||||||
|
show:false,
|
||||||
|
// 标题
|
||||||
|
title: '修改昵称',
|
||||||
|
// 修改类型
|
||||||
|
editType:2,
|
||||||
|
// 提交表单
|
||||||
|
form:{},
|
||||||
|
// 手机号
|
||||||
|
mobile: "",
|
||||||
|
// 验证码
|
||||||
|
code:"",
|
||||||
|
codeText: '获取验证码',
|
||||||
|
// 是否正在获取验证码
|
||||||
|
isCode:false,
|
||||||
|
timestamp:60,
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{
|
||||||
|
required: true,message: '请填写昵称',
|
||||||
|
// 可以单个或者同时写两个触发验证方式
|
||||||
|
trigger: 'blur,change'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
mobile: [
|
||||||
|
{ required: true, message: '请输入手机号', trigger: ['change','blur'], },
|
||||||
|
{
|
||||||
|
// 自定义验证函数,见上说明
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||||
|
// this.$u.test.mobile()就是返回true或者false的
|
||||||
|
return this.$u.test.mobile(value);
|
||||||
|
},
|
||||||
|
message: '手机号码不正确',
|
||||||
|
// 触发器可以同时用blur和change
|
||||||
|
trigger: ['change','blur'],
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
this.editType = e.editType
|
||||||
|
if (this.editType == 0){
|
||||||
|
this.title = "修改昵称"
|
||||||
|
}else if(this.editType == 1){
|
||||||
|
this.title = "修改手机号"
|
||||||
|
}else if(this.editType == 2){
|
||||||
|
this.title = "我的车"
|
||||||
|
}else{
|
||||||
|
this.title = "支付密码"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
||||||
|
onReady() {
|
||||||
|
// this.$refs.uForm.setRules(this.rules);
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getUser()
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 数字键盘确定按钮
|
||||||
|
submitAmount(){
|
||||||
|
if (this.value!=""){
|
||||||
|
this.show = false
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title:"请输入车牌号",
|
||||||
|
icon:"error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
valChange(val) {
|
||||||
|
// 按键震动
|
||||||
|
uni.vibrateShort({
|
||||||
|
success: function () {}
|
||||||
|
});
|
||||||
|
// 将每次按键的值拼接到value变量中,注意+=写法
|
||||||
|
this.value += val;
|
||||||
|
this.form.carNo += val;
|
||||||
|
},
|
||||||
|
// 退格键被点击
|
||||||
|
backspace() {
|
||||||
|
uni.vibrateShort({
|
||||||
|
success: function () {}
|
||||||
|
});
|
||||||
|
// 删除value的最后一个字符
|
||||||
|
if (this.value.length) {
|
||||||
|
this.value = this.value.substr(0, this.value.length - 1);
|
||||||
|
this.form.carNo = this.value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 倒计时60s
|
||||||
|
countdown(){
|
||||||
|
let _this = this
|
||||||
|
setInterval(() => {
|
||||||
|
// countdown减1
|
||||||
|
_this.timestamp--;
|
||||||
|
_this.codeText = _this.timestamp+"秒重新获取"
|
||||||
|
// 如果倒计时为0,清除定时器
|
||||||
|
if(_this.timestamp === 0) {
|
||||||
|
_this.isCode = false
|
||||||
|
_this.timestamp = 60
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
// 获取验证码
|
||||||
|
getCode() {
|
||||||
|
this.isCode = true
|
||||||
|
// 调用后端接口
|
||||||
|
this.countdown()
|
||||||
|
},
|
||||||
|
// 查询当前登录用户信息
|
||||||
|
getUser(){
|
||||||
|
request({
|
||||||
|
url: 'business/userManager/user/getUser',
|
||||||
|
method: 'get',
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data != null && res.data != "" && res.data != undefined) {
|
||||||
|
this.form = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交表单
|
||||||
|
submit(){
|
||||||
|
// this.$refs.uForm.validate(valid => {
|
||||||
|
// if (valid) {
|
||||||
|
// console.log('验证通过');
|
||||||
|
request({
|
||||||
|
url: 'business/userManager/user/edit',
|
||||||
|
method: 'put',
|
||||||
|
data:this.form,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pagesMy/setup/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// } else {
|
||||||
|
// console.log('验证失败');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.pBox{
|
||||||
|
width: 90%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.but-sub{
|
||||||
|
width: 100%;
|
||||||
|
height: 45px;
|
||||||
|
line-height: 45px;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 20px;
|
||||||
|
background-color: #2b7aff;
|
||||||
|
color: white;
|
||||||
|
border-radius: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-top: 88px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-header {
|
||||||
|
width: 100%;
|
||||||
|
height: 88px;
|
||||||
|
background: #ffffff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
color: #000;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0px 15px;
|
||||||
|
padding-top: 40px;
|
||||||
|
|
||||||
|
.my-icons {
|
||||||
|
width: 20px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
position: fixed;
|
||||||
|
top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-hang {
|
||||||
|
background-color: white;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 15px 10px;
|
||||||
|
border-bottom: 1px solid #f4f5f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.touxiang {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 50%;
|
||||||
|
overflow: hidden;
|
||||||
|
// background-color: #f4f5f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dis {
|
||||||
|
color: #a69999;
|
||||||
|
}
|
||||||
|
</style>
|
@ -2,35 +2,42 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="my-header">
|
<view class="my-header">
|
||||||
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
|
<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 class="my-icons"></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 顶部区域 -->
|
<!-- 顶部区域 -->
|
||||||
<view class="box-hang">
|
<button class="box-hang" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
||||||
<view class="">头像</view>
|
<view class="">头像</view>
|
||||||
<view class="touxiang"></view>
|
<view class="touxiang">
|
||||||
</view>
|
<image class="touxiang" v-if="user.avatar!='' && user.avatar!=null && user.avatar!=undefined" :src="baseUrl + user.avatar" mode=""></image>
|
||||||
<view class="box-hang">
|
<image class="touxiang" v-else src="@/static/imgs/myx.png" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</button>
|
||||||
|
<view class="box-hang" @click="goEdit(0)">
|
||||||
<view class="">昵称</view>
|
<view class="">昵称</view>
|
||||||
<view class="dis"> <text>修改昵称</text> <uni-icons type="right" size="16"></uni-icons> </view>
|
<view class="dis">
|
||||||
|
<text v-if="user.name==''">未填写</text>
|
||||||
|
<text>{{user.name}}</text>
|
||||||
|
<uni-icons type="right" size="16"></uni-icons>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box-hang">
|
<view class="box-hang">
|
||||||
<view class="">手机号</view>
|
<view class="">手机号</view>
|
||||||
<view class="dis"> <text></text> <uni-icons type="right" size="16"></uni-icons> </view>
|
<view class="dis"> <text>{{user.mobile}}</text> <uni-icons type="right" size="16"></uni-icons> </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box-hang">
|
<view class="box-hang">
|
||||||
<view class="">会员卡号</view>
|
<view class="">会员号</view>
|
||||||
<view class="dis"> <text></text> <uni-icons type="right" size="16"></uni-icons> </view>
|
<view class="dis"> <text>{{user.userNo}}</text> <uni-icons type="right" size="16"></uni-icons> </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box-hang">
|
<view class="box-hang" @click="goEdit(2)">
|
||||||
<view class="">车牌号</view>
|
<view class="">车牌号</view>
|
||||||
<view class="dis"> <text></text> <uni-icons type="right" size="16"></uni-icons> </view>
|
<view class="dis"> <text>{{user.carNo}}</text> <uni-icons type="right" size="16"></uni-icons> </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box-hang">
|
<!-- <view class="box-hang" @click="goEdit(3)">
|
||||||
<view class="">支付密码</view>
|
<view class="">支付密码</view>
|
||||||
<view class="dis"> <text></text> <uni-icons type="right" size="16"></uni-icons> </view>
|
<view class="dis"> <text></text> <uni-icons type="right" size="16"></uni-icons> </view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -38,20 +45,87 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import request from "../../utils/request";
|
||||||
|
import upload from '@/utils/upload.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
|
// 用户信息
|
||||||
|
user:{
|
||||||
|
// 用户头像
|
||||||
|
avatar:"",
|
||||||
|
},
|
||||||
|
// url信息
|
||||||
|
baseUrl: this.$baseUrl,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getUser()
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goback() {
|
// 用户选择头像
|
||||||
|
onChooseAvatar(e){
|
||||||
|
let _this = this;
|
||||||
|
let tempFilePath = e.detail.avatarUrl //上传的图片地址
|
||||||
|
let maxSizeInBytes = 1024*1024 //限制大小
|
||||||
|
uni.getFileInfo({
|
||||||
|
filePath:tempFilePath,
|
||||||
|
success(res) {
|
||||||
|
let fileSize = res.size
|
||||||
|
if (fileSize > maxSizeInBytes){
|
||||||
|
uni.showToast({
|
||||||
|
title:"请上传小于1MB的图片",
|
||||||
|
icon:"error"
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log(tempFilePath)
|
||||||
|
// 将图片上传服务器
|
||||||
|
upload({
|
||||||
|
url: '/clientApi/file/upload',
|
||||||
|
filePath: tempFilePath,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log('images', res.data.fileName);
|
||||||
|
_this.user.avatar = res.data.fileName
|
||||||
|
_this.editUser()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 修改用户信息
|
||||||
|
editUser(){
|
||||||
|
request({
|
||||||
|
url: 'business/userManager/user/edit',
|
||||||
|
method: 'put',
|
||||||
|
data:this.user,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.getUser()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 跳转修改页面
|
||||||
|
goEdit(val){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesMy/editUser/index?editType=' + val,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查询当前登录用户信息
|
||||||
|
getUser(){
|
||||||
|
request({
|
||||||
|
url: 'business/userManager/user/getUser',
|
||||||
|
method: 'get',
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data != null && res.data != "" && res.data != undefined) {
|
||||||
|
this.user = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,11 +177,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.touxiang {
|
.touxiang {
|
||||||
width: 45px;
|
width: 50px;
|
||||||
height: 45px;
|
height: 50px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #f4f5f6;
|
// background-color: #f4f5f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dis {
|
.dis {
|
||||||
|
@ -21,11 +21,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="desc">
|
<view class="desc">
|
||||||
<view>加油金额</view>
|
<view>加油金额</view>
|
||||||
<view>¥{{oilOrder.orderAmount}}</view>
|
<view>{{oilOrder.orderAmount}}元</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="desc">
|
<view class="desc">
|
||||||
<view>加油数量</view>
|
<view>加油数量</view>
|
||||||
<view>{{oilOrder.oilNum}}L</view>
|
<view>{{oilOrder.oilNum}}升</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="desc">
|
<view class="desc">
|
||||||
<view>油品单价</view>
|
<view>油品单价</view>
|
||||||
@ -58,10 +58,30 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="desc">
|
<view class="desc" >
|
||||||
|
<view style="display: flex;">
|
||||||
|
满减活动优惠
|
||||||
|
<span style="display: flex;">(满减活动})</span>
|
||||||
|
</view>
|
||||||
|
<view style="display: flex;">
|
||||||
|
<span style="margin-right: 10px;">-¥{{fullRedece}}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="desc" >
|
||||||
|
<view style="display: flex;">
|
||||||
|
优惠券优惠
|
||||||
|
<span style="display: flex;">(优惠券)</span>
|
||||||
|
</view>
|
||||||
|
<view style="display: flex;">
|
||||||
|
<span style="margin-right: 10px;">-¥{{couponRedece}}</span>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="desc" v-if="isGradePreferential">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
会员等级优惠
|
会员等级优惠
|
||||||
<span style="display: flex;">(会员等级)</span>
|
<span style="display: flex;">({{userGrade.name}})</span>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;">-¥{{gradeRedece}}</span>
|
<span style="margin-right: 10px;">-¥{{gradeRedece}}</span>
|
||||||
@ -109,6 +129,8 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// 小程序类型 微信 WECHAT 支付宝 ALIPAY
|
||||||
|
appltType: "WECHAT",
|
||||||
gradeDis:"",
|
gradeDis:"",
|
||||||
title: '',
|
title: '',
|
||||||
value: true,
|
value: true,
|
||||||
@ -137,7 +159,8 @@
|
|||||||
gradeRedece:0,
|
gradeRedece:0,
|
||||||
fullRedece:0,
|
fullRedece:0,
|
||||||
couponRedece:0,
|
couponRedece:0,
|
||||||
hoardAmount:0,
|
// 消费储值卡后的金额(未扣除优惠金额前的金额)
|
||||||
|
deductAmount:0,
|
||||||
// 囤油卡信息
|
// 囤油卡信息
|
||||||
refuelMoney:[],
|
refuelMoney:[],
|
||||||
// 会员等级优惠信息
|
// 会员等级优惠信息
|
||||||
@ -154,11 +177,13 @@
|
|||||||
isOilStorageCard:false,
|
isOilStorageCard:false,
|
||||||
// 是否使用储值卡
|
// 是否使用储值卡
|
||||||
isStoreValueCard:false,
|
isStoreValueCard:false,
|
||||||
|
// 是否存在可使用的等级优惠
|
||||||
|
isGradePreferential:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
// this.orderNo = e.orderNo
|
this.orderNo = e.orderNo
|
||||||
this.orderNo = "234520231226154037a1f53b"
|
// this.orderNo = "234520231226154037a1f53b"
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getOilOrder();
|
this.getOilOrder();
|
||||||
@ -189,13 +214,13 @@
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: map,
|
data: map,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
let payProvider = "wxpay"
|
let payProvider = "wxpay"
|
||||||
// if (_this.appltType== "WECHAT"){
|
if (_this.appltType== "WECHAT"){
|
||||||
// payProvider = "wxpay"
|
payProvider = "wxpay"
|
||||||
// }else{
|
}else{
|
||||||
// payProvider = "alipay"
|
payProvider = "alipay"
|
||||||
// }
|
}
|
||||||
if (res.data.reservedPayInfo!=null && res.data.reservedPayInfo!=""){
|
if (res.data.reservedPayInfo!=null && res.data.reservedPayInfo!=""){
|
||||||
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
@ -212,7 +237,7 @@
|
|||||||
// 支付签名
|
// 支付签名
|
||||||
paySign: _this.orderInfo.paySign,
|
paySign: _this.orderInfo.paySign,
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('success:',res);
|
console.log('success');
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pagesRefuel/orderSuccess/index'
|
url: '/pagesRefuel/orderSuccess/index'
|
||||||
})
|
})
|
||||||
@ -271,6 +296,7 @@
|
|||||||
})
|
})
|
||||||
if (falg == false) {
|
if (falg == false) {
|
||||||
this.chooseCardBalance(0)
|
this.chooseCardBalance(0)
|
||||||
|
this.chooseGrade(this.user.gradeId)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查看是否有可使用的储值卡金额
|
// 查看是否有可使用的储值卡金额
|
||||||
@ -283,6 +309,7 @@
|
|||||||
this.balanceRedece = this.oilOrder.orderAmount
|
this.balanceRedece = this.oilOrder.orderAmount
|
||||||
} else {
|
} else {
|
||||||
this.balanceRedece = this.user.cardBalance
|
this.balanceRedece = this.user.cardBalance
|
||||||
|
this.deductAmount = this.oilOrder.orderAmount - this.balanceRedece
|
||||||
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece
|
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@ -296,6 +323,8 @@
|
|||||||
this.payAmount = (this.oilOrder.orderAmount - residueAmount - this.balanceRedece).toFixed(2)
|
this.payAmount = (this.oilOrder.orderAmount - residueAmount - this.balanceRedece).toFixed(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
this.deductAmount = this.oilOrder.orderAmount
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查看是否有可使用的会员等级优惠
|
// 查看是否有可使用的会员等级优惠
|
||||||
@ -305,41 +334,155 @@
|
|||||||
url: "business/userManager/userGrade/isUse/" + id,
|
url: "business/userManager/userGrade/isUse/" + id,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res,that.oilType)
|
|
||||||
if (res.data != null && res.data != ""){
|
if (res.data != null && res.data != ""){
|
||||||
|
that.userGrade = res.data
|
||||||
if (res.data.preferential== "自定义优惠"){
|
if (res.data.preferential== "自定义优惠"){
|
||||||
if (that.oilType == "汽油"){
|
if (that.oilType == "汽油"){
|
||||||
// 将数组按照金额从小到大排序
|
// 将数组按照金额从小到大排序
|
||||||
let gasolineRule = JSON.parse(res.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
let gasolineRule = JSON.parse(res.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||||
console.log(gasolineRule,222)
|
|
||||||
if (res.data.gasolineDiscount == "满减优惠"){
|
if (res.data.gasolineDiscount == "满减优惠"){
|
||||||
for (let i = 0; i<gasolineRule.length; i++){
|
if (gasolineRule.length > 1){
|
||||||
if (that.oilOrder.orderAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
for (let i = 1; i<gasolineRule.length; i++){
|
||||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||||
break;
|
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||||
|
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
}else{
|
||||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
that.isGradePreferential = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (res.data.gasolineDiscount == "每升优惠"){
|
if (res.data.gasolineDiscount == "每升优惠"){
|
||||||
|
if (gasolineRule.length > 1){
|
||||||
|
for (let i = 1; i<gasolineRule.length; i++){
|
||||||
|
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||||
|
// 计算升数 和 优惠金额
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (that.oilType == "柴油"){
|
if (that.oilType == "柴油"){
|
||||||
|
// 将数组按照金额从小到大排序
|
||||||
|
let dieselRule = JSON.parse(res.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
||||||
|
if (res.data.dieselDiscount == "满减优惠"){
|
||||||
|
if (dieselRule.length > 1){
|
||||||
|
for (let i = 1; i<dieselRule.length; i++){
|
||||||
|
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||||
|
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||||
|
that.gradeRedece = dieselRule[i - 1].dieselRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||||
|
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (res.data.dieselDiscount == "每升优惠"){
|
||||||
|
if (dieselRule.length > 1){
|
||||||
|
for (let i = 1; i<dieselRule.length; i++){
|
||||||
|
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||||
|
// 计算升数 和 优惠金额
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (that.oilType == "天然气"){
|
if (that.oilType == "天然气"){
|
||||||
|
// 将数组按照金额从小到大排序
|
||||||
|
let naturalGasRule = JSON.parse(res.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||||
|
if (res.data.naturalGasDiscount == "满减优惠"){
|
||||||
|
if (naturalGasRule.length > 1){
|
||||||
|
for (let i = 1; i<naturalGasRule.length; i++){
|
||||||
|
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||||
|
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||||
|
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||||
|
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (res.data.naturalGasDiscount == "每升优惠"){
|
||||||
|
if (naturalGasRule.length > 1){
|
||||||
|
for (let i = 1; i<naturalGasRule.length; i++){
|
||||||
|
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||||
|
// 计算升数 和 优惠金额
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||||
|
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||||
|
that.isGradePreferential = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
that.countPayMent()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 计算用户应付金额
|
||||||
|
countPayMent(){
|
||||||
|
this.payAmount = this.deductAmount - this.gradeRedece - this.fullRedece - this.couponRedece;
|
||||||
|
},
|
||||||
|
|
||||||
// 根据用户id查询用户信息
|
// 根据用户id查询用户信息
|
||||||
getUser(id){
|
getUser(id){
|
||||||
let _this = this;
|
let _this = this;
|
||||||
@ -347,15 +490,14 @@
|
|||||||
url: "business/userManager/user/" + id,
|
url: "business/userManager/user/" + id,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
// console.log(res)
|
|
||||||
_this.user = res.data;
|
_this.user = res.data;
|
||||||
if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
|
if (res.data.refuelMoney!=null && res.data.refuelMoney!=""){
|
||||||
_this.refuelMoney = JSON.parse(res.data.refuelMoney)
|
_this.refuelMoney = JSON.parse(res.data.refuelMoney)
|
||||||
_this.chooseRefuelMoney()
|
_this.chooseRefuelMoney()
|
||||||
}else{
|
}else{
|
||||||
_this.chooseCardBalance(0)
|
_this.chooseCardBalance(0)
|
||||||
|
_this.chooseGrade(res.data.gradeId)
|
||||||
}
|
}
|
||||||
_this.chooseGrade(res.data.gradeId)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取油品订单
|
// 获取油品订单
|
||||||
|
Loading…
Reference in New Issue
Block a user