This commit is contained in:
cun-nan 2024-01-30 16:04:49 +08:00
parent 8b907e9ad0
commit 79c152ca76
15 changed files with 286 additions and 179 deletions

View File

@ -87,7 +87,7 @@ export default {
AMapLoader.load({
key: "b5abec514cab7c71cb0572765131e6fc", // WebKey load
version: "2.0", // JSAPI 1.4.15
plugins: ["AMap.Geocoder", "AMap.AutoComplete","AMap.DistrictSearch"], // 使'AMap.Scale'
plugins: ["AMap.Geocoder", "AMap.AutoComplete","AMap.DistrictSearch","AMap.PlaceSearch","AMap.Autocomplete"], // 使'AMap.Scale'
}).then((AMap) => {
this.map = new AMap.Map("container", {
viewMode: "2D", //3D
@ -173,22 +173,45 @@ export default {
this.initAMap();
}
},
getLngLat(){
async getLngLat(){
let _this = this;
const geocoder = new AMap.Geocoder()
// const geocoder = new AMap.Geocoder()
// // ,cName:
// geocoder.getLocation(this.form.address, (status, result) => {
// if (status === 'complete' && result.info === 'OK') {
// //
// _this.form.lng = result.geocodes[0].location.lng
// _this.form.lat = result.geocodes[0].location.lat
// _this.toGeoCoder();
// _this.pasVal();
// _this.initAMap();
// } else {
// this.$modal.msgError("");
// }
// })
// ,cName:
geocoder.getLocation(this.form.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
//
_this.form.lng = result.geocodes[0].location.lng
_this.form.lat = result.geocodes[0].location.lat
_this.toGeoCoder();
_this.pasVal();
_this.initAMap();
} else {
this.$modal.msgError("定位失败");
}
})
var map = new AMap.Map("container", {
resizeEnable: true
});
// AMap.service(["AMap.PlaceSearch"], function() {
//
var placeSearch = new AMap.Autocomplete({
input: "tipinput"
});
//
placeSearch.search(this.form.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
//
_this.form.lng = result.tips[0].location.lng
_this.form.lat = result.tips[0].location.lat
_this.toGeoCoder();
_this.pasVal();
_this.initAMap();
} else {
this.$modal.msgError("定位失败");
}
})
// });
},
//
currentSelect(val) {

View File

@ -181,7 +181,7 @@
type="primary"
icon="el-icon-plus"
@click="handleAdd"
>新增固定等级类型</el-button>
>新增企业会员等级类型</el-button>
<el-table ref="tables" v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
@ -543,7 +543,7 @@
</div>
</el-dialog>
<!-- 添加固定等级或修改对话框 -->
<!-- 添加企业会员等级或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" class="roll-dialog"
:close-on-click-modal="false" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
@ -851,7 +851,7 @@ export default {
activeName: 'member',
//
showSearch: true,
//
//
fixingLevelList:[],
//
userList:[],
@ -1011,7 +1011,7 @@ export default {
this.queryParams.page = 1;
this.getListMember();
},
//
//
getList(){
this.loading = true;
listFixingLevel(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
@ -1089,7 +1089,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = "新增固定等级类型";
this.title = "新增企业会员等级类型";
},
//
handleAddMember() {
@ -1166,7 +1166,7 @@ export default {
getFixingLevel(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "编辑固定等级类型";
this.title = "编辑企业会员等级类型";
if (response.data.gasolineRule){
this.gasolinePreferential = JSON.parse(response.data.gasolineRule)
}
@ -1208,7 +1208,7 @@ export default {
this.openMembers = false;
this.reset2();
},
//
//
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
@ -1222,13 +1222,13 @@ export default {
this.open = false;
this.getList();
}else {
this.$modal.msgError("认证类型失败,固定等级名称不可重复");
this.$modal.msgError("认证类型失败,企业会员等级名称不可重复");
}
});
} else {
// queryFixingLevel({name:this.form.name}).then( response => {
// if(response.data!=null){
// this.$modal.msgError("");
// this.$modal.msgError("");
// }else {
addFixingLevel(this.form).then(response => {
if (response.data==1) {
@ -1236,7 +1236,7 @@ export default {
this.open = false;
this.getList();
}else {
this.$modal.msgError("固定等级名称不可重复");
this.$modal.msgError("企业会员等级名称不可重复");
}
});
// }
@ -1315,7 +1315,7 @@ export default {
//
handleDelete(row) {
const name = row.name
this.$modal.confirm('所绑定的认证会员信息将会失效!!确定删除"' + name + '"的固定等级信息?').then(function() {
this.$modal.confirm('所绑定的认证会员信息将会失效!!确定删除"' + name + '"的企业会员等级信息?').then(function() {
// return deleteMember(row.id);
return delFixingLevel(row.id);
}).then(() => {

View File

@ -567,8 +567,17 @@ export default {
this.getStatistic();
this.getConfig();
this.getUserList();
this.queryUserList();
},
methods: {
//
queryUserList(){
let _this = this;
setInterval(function (){
_this.getList();
_this.getStatistic();
},5000)
},
//
goDedi(id){
this.$router.push({
@ -625,6 +634,7 @@ export default {
this.queryParams.cardBalance = ''
}
this.getList();
this.getStatistic();
},
//
resetQuery() {

View File

@ -169,7 +169,7 @@
<!-- <el-row>-->
<el-col :span="8">
<el-form-item label="登录密码" prop="password">
<el-input v-model="form.password" type="password" placeholder="不填写默认123456" maxlength="30"/>
<el-input v-model="form.password" type="password" @input="changePassword" placeholder="不填写默认123456" maxlength="30"/>
</el-form-item>
</el-col>
@ -422,6 +422,7 @@ export default {
mobile: '',
status: ''
},
ifEditPassword:false,
//
rules: {
realName: [
@ -638,6 +639,9 @@ export default {
this.open = false;
this.reset();
},
changePassword(){
this.ifEditPassword = true
},
//
submitForm: function() {
this.$refs["form"].validate(valid => {
@ -662,6 +666,9 @@ export default {
}
})
} else {
if (!this.ifEditPassword){
this.form.password = ""
}
updateStaff(this.form).then(response => {
if (response.data==1){
this.$modal.msgSuccess("修改成功");
@ -684,7 +691,7 @@ export default {
getStaff(id).then(response => {
this.form = response.data;
this.form.password = '123456'
this.form.refundPassword = '123456'
// this.form.refundPassword = '123456'
this.open = true;
this.title = "编辑员工信息";
if (this.form.auditPrem && this.form.auditPrem.length > 0){

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.repository.model.TAccount;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.io.FileNotFoundException;
@ -14,6 +15,7 @@ import java.util.List;
/**
* 员工管理 业务层
*/
@Transactional
public interface ILJStaffService extends IService<LJStaff> {
/**
* 根据条件分页查询员工信息

View File

@ -221,15 +221,19 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
row = baseMapper.updateById(staff);
if (StringUtils.isNotEmpty(staff.getPassword())){
TAccount tAccount = accountService.selectAccountByStaffId(staff.getId());
tAccount.setPassword(staff.getPassword());
if (tAccount.getAccountName().matches("\\d+")){
tAccount.setAccountName(staff.getMobile());
}
accountService.entryptPassword(tAccount);
try {
accountService.editAccount(tAccount,null);
}catch (Exception e){
e.printStackTrace();
if (ObjectUtil.isNotEmpty(tAccount)) {
if (StringUtils.isNotEmpty(staff.getPassword())) {
tAccount.setPassword(staff.getPassword());
accountService.entryptPassword(tAccount);
}
if (tAccount.getAccountName().matches("\\d+")) {
tAccount.setAccountName(staff.getMobile());
}
try {
accountService.editAccount(tAccount, null);
} catch (Exception e) {
e.printStackTrace();
}
}
}
return row;

View File

@ -41,13 +41,20 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
public LJStore selectStoreById() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
LJStore store = baseMapper.selectById(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",storeId);
queryWrapper.eq("if_delete","0");
LJStore store = baseMapper.selectOne(queryWrapper);
return store;
}
@Override
public LJStore queryStoreById(int id) {
return baseMapper.selectById(id);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
queryWrapper.eq("if_delete","0");
queryWrapper.eq("status","qy");
return baseMapper.selectOne(queryWrapper);
}
/**
@ -62,7 +69,10 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
@Override
public LJStore selectStoreByStoreId(int storeId) {
LJStore store = baseMapper.selectById(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",storeId);
queryWrapper.eq("if_delete","0");
LJStore store = baseMapper.selectOne(queryWrapper);
return store;
}
@ -235,7 +245,10 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
*/
@Override
public List<LJStore> selectStoreList() {
return baseMapper.selectList(null);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("if_delete","0");
queryWrapper.eq("status","qy");
return baseMapper.selectList(queryWrapper);
}
@Override
@ -245,6 +258,7 @@ public class LJStoreServiceImpl extends ServiceImpl<LJStoreMapper, LJStore> impl
Integer chainStoreId = store.getChainStoreId();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",chainStoreId);
queryWrapper.eq("if_delete","0");
List<LJStore> list = baseMapper.selectList(queryWrapper);
return list;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -49,9 +49,9 @@
</div>
</div>
<div class="center-left-hj">
<div class="hj-box" style="justify-content: left">油品:{{ oilAmount }}</div>
<div class="hj-box" style="border-left: 1px solid #d1d1d4; border-right: 1px solid #d1d1d4;">商品:{{ goodsAmount }}</div>
<div class="hj-box" style="justify-content: flex-end">合计: {{ oilAmount + goodsAmount }}</div>
<div class="hj-box" style="justify-content: left">油品:{{ oilAmount.toFixed(2) }}</div>
<div class="hj-box" style="border-left: 1px solid #d1d1d4; border-right: 1px solid #d1d1d4;">商品:{{ goodsAmount.toFixed(2) }}</div>
<div class="hj-box" style="justify-content: flex-end">合计: {{ (oilAmount + goodsAmount).toFixed(2) }}</div>
</div>
<div class="center-left-hj">
<div>
@ -87,7 +87,7 @@
</div>
</el-popover>
</div>
<div>-{{ fullReduction }}</div>
<div>-{{ fullReduction.toFixed(2) }}</div>
</div>
<div class="center-left-hj" v-show="isMember && gradeDiscount.length>0">
<div>
@ -118,7 +118,7 @@
</div>
</el-popover>
</div>
<div>-{{ oilDiscount }}</div>
<div>-{{ oilDiscount.toFixed(2) }}</div>
</div>
<div class="center-left-hj" v-show="isMember && refuelMoney">
<div>
@ -133,7 +133,7 @@
余额{{ item.refuelMoney }}L
</div>
</div>
<div>- {{ consumeRefuelMoney }}L</div>
<div>- {{ consumeRefuelMoney.toFixed(2) }}L</div>
</div>
<div class="center-left-hj" v-show="isMember">
<div>
@ -174,7 +174,7 @@
</div>
</el-popover>
</div>
<div>-{{ couponAmount }}</div>
<div>-{{ couponAmount.toFixed(2) }}</div>
</div>
<div class="center-left-th">
<div class="th-box">
@ -183,7 +183,7 @@
</div>
<div class="th-box">
<div>找零</div>
<div class="bule">{{ seekZero }}</div>
<div class="bule">{{ seekZero.toFixed(2) }}</div>
</div>
<div class="th-box">
<div @click="dialogVisible = true">加油员</div>
@ -208,7 +208,7 @@
<div class="center-left-bottom">
<div>
<div class="bottom-price">{{ ((+oilActualPay) + (+goodsActualPay)).toFixed(2) }}</div>
<div class="price-red">优惠合计{{ oilDiscount + goodsDiscount + fullReduction + couponAmount }}/{{consumeRefuelMoney}}L</div>
<div class="price-red">优惠合计{{ (oilDiscount + goodsDiscount + fullReduction + couponAmount).toFixed(2) }}/{{consumeRefuelMoney.toFixed(2)}}L</div>
</div>
<el-button class="center-left-lv" :disabled="(oilAmount + goodsAmount)==0" @click="settlement">立即结算</el-button>
</div>
@ -255,7 +255,7 @@
<!-- -->
<div class="content-top-bottom">
<div>订单笔数 <span class="bule">{{ oilTotal }}</span> </div>
<div>订单金额 <span class="bule">{{ oilAmount }}</span> </div>
<div>订单金额 <span class="bule">{{ oilAmount.toFixed(2) }}</span> </div>
</div>
</div>
</div>
@ -315,7 +315,7 @@
</div>
<div class="content-top-bottom">
<div>商品数量 <span class="bule">{{ goodsTotal }}</span> </div>
<div>商品总额 <span class="bule">{{ goodsAmount }}</span> </div>
<div>商品总额 <span class="bule">{{ goodsAmount.toFixed(2) }}</span> </div>
</div>
</div>
</div>
@ -443,7 +443,7 @@
v-loading="loading">
<div style="text-align: center;font-size: 15px;font-weight: bold">应收金额</div>
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
{{ +oilActualPay + (+goodsActualPay) }}
{{ ((+oilActualPay) + (+goodsActualPay)).toFixed(2) }}
</div>
<div style="text-align: center;margin-bottom: 10px">
合计金额{{ (oilAmount + goodsAmount).toFixed(2) }}优惠合计{{ (oilDiscount + goodsDiscount + fullReduction + couponAmount).toFixed(2) }}
@ -481,7 +481,7 @@
</div>
<div style="text-align: right;margin: 10px 0">
<span>应找零</span>
<span style="color: red;font-size: 18px"> {{ seekZero }}</span>
<span style="color: red;font-size: 18px"> {{ seekZero.toFixed(2) }}</span>
</div>
</div>
<el-divider></el-divider>
@ -583,7 +583,7 @@
</div>
<div class="amount">
<span>油品单价</span>
<span class="amountBlue">{{ form.oilPrice }}/L</span>
<span class="amountBlue">{{ form.oilPrice }}/{{ form.unit }}</span>
</div>
<div >
<el-input v-model="amount" v-focus @input="form.amount = amount" placeholder="请输入加油金额"
@ -775,23 +775,23 @@
</div>
<div class="input-box">
<div>合计</div>
<div>{{ oilAmount+(+goodsAmount) }}</div>
<div>{{ (oilAmount+(+goodsAmount)).toFixed(2) }}</div>
</div>
<div class="input-box" v-if="(oilDiscount + goodsDiscount + fullReduction + couponAmount)>0">
<div>优惠合计</div>
<div>{{ oilDiscount + goodsDiscount + fullReduction + couponAmount }}</div>
<div>{{ (oilDiscount + goodsDiscount + fullReduction + couponAmount).toFixed(2) }}</div>
</div>
<div class="input-box" v-if="isMember">
<div class="input-box" v-if="isMember && consumeAmount>0">
<div>储值卡或囤油卡付款</div>
<div>{{ consumeAmount.toFixed(2) }}</div>
</div>
<div class="input-box">
<div>实付款</div>
<div>{{ (+oilActualPay)+(+goodsActualPay) }}</div>
<div>{{ ((+oilActualPay)+(+goodsActualPay)).toFixed(2) }}</div>
</div>
<div class="input-box" v-if="seekZero>0">
<div>找零</div>
<div>{{ seekZero }}</div>
<div>{{ seekZero.toFixed(2) }}</div>
</div>
</div>
</div>
@ -1341,7 +1341,7 @@
},
//
changeSeekZero(){
this.seekZero = (this.authCode - this.oilActualPay - this.goodsActualPay).toFixed(2)
this.seekZero = this.authCode - this.oilActualPay - this.goodsActualPay
},
// id
getGradeName(list,id){
@ -2505,6 +2505,7 @@
},
//
async collection(){
this.loading = true;
if (this.payType=="CASH"){
if (this.authCode<((+this.oilActualPay) + (+this.goodsActualPay)) || this.seekZero<0){
this.$modal.msgError("请输入正确的金额");
@ -2547,7 +2548,6 @@
}
await scanAppletQrCode(_this.map).then( resp => {
if (resp.data.success=='success'){
this.loading = true;
setTimeout(function (){
_this.loading = false;
_this.isPaySuccess = true;
@ -2556,7 +2556,6 @@
_this.resetting1();
},3000)
}else {
this.loading = true;
setTimeout(function (){
_this.loading = false;
_this.isPaySuccess = false;
@ -2649,6 +2648,7 @@
_this.goodsOrder = []
_this.amount = 0
_this.seekZero = 0;
_this.fullReduction = 0;
};
this.userNo = ""
this.map = {

View File

@ -198,45 +198,51 @@
if (query.userId) {
uni.setStorageSync("y_userId", query.userId)
}
if (uni.getStorageSync("appltType") == "WECHAT") {
const q = decodeURIComponent(query.q) //
if (query.q) {
let str = q.split("?")[1];
let storeId = "19";
if (query.q) {
let str = q.split("?")[1];
let storeId = "19";
let staffId = "";
if (str.includes("&")) {
let arr = str.split("&");
arr.forEach(item => {
if (item.includes("storeId")) {
storeId = item.split("=")[1]
} else {
staffId = item.split("=")[1]
}
})
} else {
storeId = str.split("=")[1]
}
let staffId = "";
if (str.includes("&")) {
let arr = str.split("&");
arr.forEach(item => {
if (item.includes("storeId")) {
storeId = item.split("=")[1]
} else {
staffId = item.split("=")[1]
}
})
} else {
storeId = str.split("=")[1]
}
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.chainStoreId = uni.getStorageSync("chainStoreId")
this.staffId = uni.getStorageSync("inviteStaffId")
await this.getUserAuthority();
await this.getOilType();
} else {
if (uni.getStorageSync("storeId")) {
this.storeId = uni.getStorageSync("storeId")
} else {
let storeId = "34";
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.chainStoreId = uni.getStorageSync("chainStoreId")
this.staffId = uni.getStorageSync("inviteStaffId")
await this.getUserAuthority();
await this.getOilType();
} else {
if (uni.getStorageSync("storeId")) {
this.storeId = uni.getStorageSync("storeId")
} else {
let storeId = "34";
uni.setStorageSync("storeId", storeId)
}
}
await this.getUserAuthority();
await this.getOilType();
await this.getTheJudgmentIsTheSame();
}else{
await this.getUserAuthority();
await this.getOilType();
await this.getTheJudgmentIsTheSame();
}
await this.getUserAuthority();
await this.getOilType();
await this.getTheJudgmentIsTheSame();
},
onShow() {
this.isJoined()
@ -634,6 +640,8 @@
uni.openLocation({
latitude: lat,
longitude: lon,
name:this.store.name,
address:this.store.address,
success: function() {
console.log('success');

View File

@ -28,48 +28,51 @@
</view> -->
</view>
<view class="fa-box">
<view class="fa-title">选择油号 <text class="top-hui"> 请务必与员工确认类型</text> </view>
<view class="wrap-box">
<!-- <view class="box-oil" :class=" {'xz' :hindex == index }" @click="getHIndex(index)"
v-for="(item,index) in 4" :key="index">
<text>92#</text>
</view> -->
<view class="box-oil" v-for="(item,index) in oilNumberList" :key="index"
:class=" {'xz' :hindex == index }" @click="getHIndex(index,item)">
<text>{{item.oilName}}</text>
<view style="height: 390px;overflow-y: scroll;">
<view class="fa-box">
<view class="fa-title">选择油号 <text class="top-hui"> 请务必与员工确认类型</text> </view>
<view class="wrap-box">
<!-- <view class="box-oil" :class=" {'xz' :hindex == index }" @click="getHIndex(index)"
v-for="(item,index) in 4" :key="index">
<text>92#</text>
</view> -->
<view class="box-oil" v-for="(item,index) in oilNumberList" :key="index"
:class=" {'xz' :hindex == index }" @click="getHIndex(index,item)">
<text>{{item.oilName}}</text>
</view>
</view>
</view>
</view>
<view class="fa-box">
<view class="fa-title">选择油枪 <text class="top-hui"> 请务必与员工确认枪号</text> </view>
<view class="wrap-box">
<!-- <view class="box-oil" :class=" {'xz' :qindex == index }" @click="getQIndex(index)"
v-for="(item,index) in 8" :key="index">
<text>{{index}}号枪</text>
</view> -->
<view class="box-oil" :class=" {'xz' :qindex == index }" v-for="(item,index) in oilGunList"
:key="index" @click="getQIndex(index,item)">
<text>{{item.gunName}}</text>
<view class="fa-box">
<view class="fa-title">选择油枪 <text class="top-hui"> 请务必与员工确认枪号</text> </view>
<view class="wrap-box">
<!-- <view class="box-oil" :class=" {'xz' :qindex == index }" @click="getQIndex(index)"
v-for="(item,index) in 8" :key="index">
<text>{{index}}号枪</text>
</view> -->
<view class="box-oil" :class=" {'xz' :qindex == index }" v-for="(item,index) in oilGunList"
:key="index" @click="getQIndex(index,item)">
<text>{{item.gunName}}</text>
</view>
</view>
</view>
</view>
<view class="fa-box">
<view class="fa-title">请输入加油金额</view>
<view class="inputkuang" @click="openKey">
<view class="sbox"></view>
<view class="sbox" style="text-align: center;font-weight: bold;">{{value}}</view>
<view class="sbox-hui">{{liters}}L</view>
</view>
<view class="wrap-box">
<view class="box-oil1" :class=" {'xz' :aindex == index }" @click="getAIndex(index,item)"
v-for="(item,index) in amountList" :key="index">
<text>{{item}}</text>
<view class="fa-box">
<view class="fa-title">请输入加油金额</view>
<view class="inputkuang" @click="openKey">
<view class="sbox"></view>
<view class="sbox" style="text-align: center;font-weight: bold;">{{value}}</view>
<view class="sbox-hui">{{liters}}L</view>
</view>
<view class="wrap-box">
<view class="box-oil1" :class=" {'xz' :aindex == index }" @click="getAIndex(index,item)"
v-for="(item,index) in amountList" :key="index">
<text>{{item}}</text>
</view>
</view>
</view>
</view>
<view class="anniu" @click="submitAmount">
<text>立即加油</text>
<view class="anniu" @click="submitAmount">
<text>立即加油</text>
</view>
</view>
</view>

View File

@ -217,6 +217,8 @@
cardFuleList: [],
actinput: 0,
// WECHAT ALIPAY
appltType: uni.getStorageSync("appltType"),
}
},
components: {},
@ -266,11 +268,12 @@
}
let _this = this
request({
url: 'business/marketingActivity/cardFuelRecord/addFuleCarRecords',
method: 'post',
data: {
payType: 'WECHAT',
payType: this.appltType,
mtStaffId: this.staffId,
id: this.carValueId,
storeId: this.storeId,
@ -279,10 +282,9 @@
cardRecordId: this.cardRecordId
},
}).then(res => {
if (res.code === 200) {
let _this = this
console.log(res)
if (uni.getStorageSync("appltType") == "WECHAT") {
if (res.code == 200) {
console.log(res,_this.appltType)
if (_this.appltType == "WECHAT") {
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
uni.requestPayment({
@ -318,9 +320,9 @@
});
}
if (uni.getStorageSync("appltType") == "ALIPAY") {
if (_this.appltType == "ALIPAY") {
my.tradePay({
tradeNO: res.data.data.reservedTransactionId
tradeNO: res.data.reservedTransactionId
}, function(resp) {
if (resp.resultCode == '9000') {
console.log("支付成功")
@ -332,7 +334,7 @@
url: "/business/allOrderInfo/orderStatus",
method: 'post',
data: {
"orderNo": res.data.data.orderNo,
"orderNo": res.data.orderNo,
"status": "payFail"
},
}).then((res) => {
@ -366,11 +368,13 @@
})
return
}
let _this = this
request({
url: 'business/marketingActivity/cardValueRecord',
method: 'post',
data: {
payType: 'WECHAT',
payType: this.appltType,
mtStaffId: this.staffId,
id: this.carValueId,
storeId: this.storeId,
@ -380,45 +384,46 @@
},
}).then(res => {
if (res.code === 200) {
let _this = this
console.log(res)
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
uni.requestPayment({
// provider: 'wxpay' 'alipay'
provider: payProvider,
timeStamp: _this.orderInfo.timeStamp,
nonceStr: _this.orderInfo.nonceStr,
package: _this.orderInfo.package,
signType: 'MD5',
paySign: _this.orderInfo.paySign,
success: function(res) {
console.log('success:', res);
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
},
fail: function(err) {
// request({
// url: "business/oilOrder/orderStatus",
// method: 'post',
// data: {
// "orderNo": res.data.data.orderNo,
// "status": "payFail"
// },
// }).then((res) => {
// uni.showToast({
// title: "!",
// icon: "error"
// })
// })
// console.log('fail:', err);
}
});
if (_this.appltType == "WECHAT") {
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
uni.requestPayment({
// provider: 'wxpay' 'alipay'
provider: payProvider,
timeStamp: _this.orderInfo.timeStamp,
nonceStr: _this.orderInfo.nonceStr,
package: _this.orderInfo.package,
signType: 'MD5',
paySign: _this.orderInfo.paySign,
success: function(res) {
console.log('success:', res);
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
},
fail: function(err) {
// request({
// url: "business/oilOrder/orderStatus",
// method: 'post',
// data: {
// "orderNo": res.data.data.orderNo,
// "status": "payFail"
// },
// }).then((res) => {
// uni.showToast({
// title: "!",
// icon: "error"
// })
// })
// console.log('fail:', err);
}
});
}
}
if (_this.appltType == "ALIPAY") {
my.tradePay({
tradeNO: res.data.data.reservedTransactionId
tradeNO: res.data.reservedTransactionId
}, function(resp) {
if (resp.resultCode == '9000') {
console.log("支付成功")
@ -442,7 +447,7 @@
url: "/business/allOrderInfo/orderStatus",
method: 'post',
data: {
"orderNo": res.data.data.orderNo,
"orderNo": res.data.orderNo,
"status": "payFail"
},
}).then((res) => {

View File

@ -218,7 +218,9 @@
},
goback() {
uni.navigateBack()
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}

View File

@ -54,7 +54,7 @@
<view class="bottom-icon">
<image src="../../static/icon/daohang.png" mode="aspectFit"></image>
</view>
<view class="">到这去</view>
<view class="" @click="goGoGo(item.store.id)">到这去</view>
</view>
<view style="color: #ececec;">
|
@ -101,6 +101,35 @@
},
methods: {
goGoGo(storeId) {
request({
url: "business/storeInformation/store/" + storeId,
method: 'get',
}).then((res) => {
if (res.data.latitude && res.data.longitude){
let lat = Number(res.data.latitude)
let lon = Number(res.data.longitude)
uni.openLocation({
latitude: lat,
longitude: lon,
name:res.data.name,
address:res.data.address,
success: function() {
console.log('success');
},
complete: function(res) {
console.log(res);
}
});
}else{
uni.showToast({
title:"当前店铺暂未设置地理位置信息!",
icon:"none"
})
}
})
},
//
queryStore(val) {
this.list = []