Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into ymf_3.0.0
This commit is contained in:
commit
c63c187ed3
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"files.associations": {
|
||||
"*.ttml": "xml",
|
||||
"*.ttss": "css"
|
||||
}
|
||||
}
|
||||
143
App.vue
143
App.vue
|
|
@ -6,8 +6,9 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
|||
import {
|
||||
onLaunch
|
||||
} from '@dcloudio/uni-app';
|
||||
|
||||
import { getFindBySource } from '@/http/yskApi/version.js'
|
||||
onLaunch(() => {
|
||||
let that = this
|
||||
uni.hideTabBar()
|
||||
// #ifdef MP-WEIXIN
|
||||
const updateManager = wx.getUpdateManager() // 小程序版本更新管理器
|
||||
|
|
@ -23,6 +24,146 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
|||
// 新版本下载失败
|
||||
})
|
||||
// #endif
|
||||
|
||||
|
||||
|
||||
//#ifdef APP-PLUS
|
||||
//获取当前系统版本信息
|
||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||
//请求后台接口 解析数据 对比版本
|
||||
console.log("widgetInfo==",widgetInfo)
|
||||
getFindBySource({source:'APP'}).then(res => {
|
||||
console.log("selectNewApp==",res)
|
||||
console.log("version===",res.url && widgetInfo.version < res.version)
|
||||
if (res.url && widgetInfo.version < res.version) {
|
||||
console.log("version===222")
|
||||
let downloadLink = res.url;
|
||||
// let downloadLink = "https://short-video.hnsiyao.cn/app/sy-duanju.apk";
|
||||
console.log(downloadLink)
|
||||
// let androidLink = res.androidWgtUrl;
|
||||
// let iosLink = res.iosWgtUrl;
|
||||
let ready = false;
|
||||
// 校验是否强制升级
|
||||
if (res.isUp == 1) {
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '发现新版本',
|
||||
confirmText: '立即更新',
|
||||
content: res.message,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading('下载中...');
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'android') {
|
||||
uni.downloadFile({
|
||||
url: downloadLink,
|
||||
success: downloadResult => {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||
entry.getParent(_oldFile=>{
|
||||
entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
console.log('newFilePath',newFilePath.fullPath)
|
||||
plus.runtime
|
||||
.install(newFilePath.fullPath, { force: false },
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
'install success...'
|
||||
);
|
||||
plus.runtime
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
}
|
||||
);
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'ios') {
|
||||
plus.runtime.openURL(downloadLink, function(
|
||||
res) {});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '发现新版本',
|
||||
confirmText: '立即更新',
|
||||
cancelText: '下次更新',
|
||||
content: res.message,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading('下载中...');
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'android') {
|
||||
uni.downloadFile({
|
||||
url: downloadLink,
|
||||
success: downloadResult => {
|
||||
if (downloadResult
|
||||
.statusCode ===
|
||||
200) {
|
||||
plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||
entry.getParent(_oldFile=>{
|
||||
entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
console.log('newFilePath',newFilePath.fullPath)
|
||||
plus.runtime
|
||||
.install(newFilePath.fullPath, { force: false },
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
'install success...'
|
||||
);
|
||||
plus.runtime
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
}
|
||||
);
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'ios') {
|
||||
plus.runtime.openURL(downloadLink, function(
|
||||
res) {});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}).catch((res)=>{
|
||||
console.log(res)
|
||||
})
|
||||
});
|
||||
|
||||
// #endif
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
import { request } from './request'
|
||||
// 会员签入 登录
|
||||
export const douyincheckIn = (data : object | any) => {
|
||||
return request('douyin/checkIn', 'POST', data, true)
|
||||
}
|
||||
// 登出
|
||||
export const userlogout = () => {
|
||||
return request('user/logout', 'POST', '', true)
|
||||
}
|
||||
// 查询绑定状态
|
||||
export const searchstorestatus = (data : object) => {
|
||||
return request('meituan/searchstorestatus', 'POST', data, true)
|
||||
}
|
||||
// 团购核销准备
|
||||
export const fulfilmentcertificateprepare = (data : object) => {
|
||||
return request('douyin/fulfilmentcertificateprepare', 'POST', data, true)
|
||||
}
|
||||
// 获取uisdk 绑定 链接
|
||||
export const getuisdk = (data : object) => {
|
||||
return request('douyin/getuisdk', 'POST', data, true)
|
||||
}
|
||||
// 团购核销
|
||||
export const certificateprepares = (data : object) => {
|
||||
return request('douyin/certificateprepare', 'POST', data, true)
|
||||
}
|
||||
// 团购核销记录
|
||||
export const orderlist = (data : object) => {
|
||||
return request('douyin/orderlist', 'POST', data, true)
|
||||
}
|
||||
// 团购核销撤销
|
||||
export const fulfilmentcertificatecanceles = (data : object) => {
|
||||
return request('douyin/fulfilmentcertificatecancel', 'POST', data, true)
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
//服务器接口地址
|
||||
const baseURL : string = 'https://czgdoumei.sxczgkj.com/index.php/api/'
|
||||
// 封装公共请求方法
|
||||
function request(url : string, method : "GET" | "POST" | undefined, data : object | any, toast : boolean) {
|
||||
let networkType = ''
|
||||
uni.getNetworkType({
|
||||
success: (res) => {
|
||||
networkType = res.networkType
|
||||
}
|
||||
});
|
||||
if (networkType == 'none') {
|
||||
uni.showToast({
|
||||
title: '网络异常,请检查网络',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (toast) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
}
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let header : any
|
||||
header = {
|
||||
'content-type': 'application/json',
|
||||
'clinttype':uni.getStorageSync('clint_type'),
|
||||
'bausertoken': uni.getStorageSync('phpuserinfo').token
|
||||
};
|
||||
uni.request({
|
||||
url: baseURL + url,
|
||||
method: method,
|
||||
data: data,
|
||||
header: header,
|
||||
success(res : any) {
|
||||
if (res.data.code != 1) {
|
||||
//是否提示错误
|
||||
if (toast) {
|
||||
uni.showToast({
|
||||
title: res.data.msg || res.data.message,
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
}, 1000)
|
||||
}
|
||||
if (res.data.code == 401) {
|
||||
uni.showToast({
|
||||
title: res.message || res.msg,
|
||||
icon: "none",
|
||||
success: () => {
|
||||
// uni.removeStorageSync('logintoken');
|
||||
// uni.removeStorageSync('token');
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
uni.hideLoading()
|
||||
reject(res.message | res.msg);
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
resolve(res.data.data);
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
uni.hideLoading()
|
||||
//请求失败
|
||||
uni.showToast({
|
||||
title: '无法连接到服务器',
|
||||
icon: 'none'
|
||||
})
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
export { request, baseURL }
|
||||
|
|
@ -202,6 +202,7 @@ function request(args) {
|
|||
method: method,
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
|
||||
)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 查询所属渠道升级版本
|
||||
* @returns
|
||||
*/
|
||||
export function getFindBySource(params) {
|
||||
return request({
|
||||
url: `/api/tbVersion/findBySource`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
@ -12,14 +12,15 @@
|
|||
<view class="block">
|
||||
<view class="border-top-0 typeEnum">
|
||||
<uni-forms-item label="商品类型" required showRequired>
|
||||
<up-radio-group v-model="FormData.type" placement="row">
|
||||
<up-radio-group v-model="FormData.type" placement="row"
|
||||
@change="changeFormDatatype">
|
||||
<up-radio v-for="(item, index) in pageData.types" :key="index"
|
||||
:label="item.name" :name="item.value">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view class="" v-if="FormData.type!='package'">
|
||||
<view class="" v-if="FormData.type!='package' && FormData.type!='weigh'">
|
||||
<uni-forms-item label="商品规格" required showRequired>
|
||||
<up-radio-group v-model="FormData.typeEnum" placement="row">
|
||||
<up-radio :custom-style="{marginRight:'30px'}"
|
||||
|
|
@ -68,12 +69,12 @@
|
|||
</uni-forms-item>
|
||||
<view class="zhezhao u-absolute position-all" @click="canEditGoodsCategory(true)"
|
||||
v-if="option.type=='edit'&&disabledChangeCategory">
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-forms-item label="单位" required showRequired name="units">
|
||||
|
||||
|
||||
<uni-data-picker :clear-icon="false" @change="unitIdChange"
|
||||
:map="{text:'name',value:'id'}" placeholder="请选择单位" popup-title="请选择单位"
|
||||
:localdata="pageData.units" v-model="FormData.unitId">
|
||||
|
|
@ -90,7 +91,7 @@
|
|||
</uni-data-picker>
|
||||
</uni-forms-item>
|
||||
</view> -->
|
||||
|
||||
|
||||
<view class="border-top" v-if="FormData.proGroupVo">
|
||||
<view class=""
|
||||
v-if=" (FormData.groupType==1&&FormData.proGroupVo.length)||(FormData.groupType==0&&FormData.proGroupVo.length&&FormData.proGroupVo[0].goods.length) ">
|
||||
|
|
@ -515,12 +516,12 @@
|
|||
<view class="block u-p-t-32 u-p-b-32">
|
||||
<view class="font-bold">
|
||||
<text class="color-red">*</text>
|
||||
<text>重量</text>
|
||||
<text>单位</text>
|
||||
</view>
|
||||
<view class=" u-m-t-16">
|
||||
<up-input v-model="FormData.weight">
|
||||
<template #suffix>
|
||||
<view class="bg-gray">千克</view>
|
||||
<view class="bg-gray">{{activeinHouseList}}</view>
|
||||
</template>
|
||||
</up-input>
|
||||
<view class="u-m-t-16 color-999 u-font-24">用于快递或配送运费计重</view>
|
||||
|
|
@ -540,11 +541,10 @@
|
|||
</view>
|
||||
</uni-forms-item>
|
||||
</view> -->
|
||||
<view class="border-top-0">
|
||||
<!-- <view class="border-top-0">
|
||||
<view class="u-flex u-row-between u-p-b-24 u-p-t-20">
|
||||
<view class="label-title">是否允许临时改价</view>
|
||||
<my-switch
|
||||
v-model="FormData.isTempPrice"></my-switch>
|
||||
<my-switch v-model="FormData.isTempPrice"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-t-24 u-p-b-24 border-top u-flex u-row-between">
|
||||
|
|
@ -573,18 +573,20 @@
|
|||
<price-number-box placeholder="请输入每人限购"
|
||||
v-model="FormData.singlePeopleLimit"></price-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view>
|
||||
<uni-forms-item label="">
|
||||
<view class="u-flex u-row-between" @tap="toTimerPage">
|
||||
<view>
|
||||
<view style="display: flex;">
|
||||
<text class="color-red">*</text>
|
||||
<view class="label-title">定时上下架</view>
|
||||
</view>
|
||||
<view class="u-flex u-font-24">
|
||||
<view>
|
||||
<view class="color-666">{{returnTimerDayText()}}</view>
|
||||
<view class="color-666 u-m-t-4" v-if="FormData.days">
|
||||
{{returnTimerTimeText()}}</view>
|
||||
{{returnTimerTimeText()}}
|
||||
</view>
|
||||
</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
|
|
@ -701,8 +703,8 @@
|
|||
<choose-guige ref="refChooseGuige" @confirm="refChooseGuigeConfirm"></choose-guige>
|
||||
<!-- 更多操作 -->
|
||||
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
|
@ -896,13 +898,13 @@
|
|||
let proGroupVoGoodsIndex = undefined
|
||||
|
||||
function refChooseGuigeOpen(skuList, groupIndex, goodsIndex) {
|
||||
console.log(groupIndex, goodsIndex)
|
||||
proGroupVoIndex = groupIndex
|
||||
proGroupVoGoodsIndex = goodsIndex
|
||||
refChooseGuige.value.open(skuList)
|
||||
}
|
||||
|
||||
function refChooseGuigeConfirm(sku) {
|
||||
console.log(sku);
|
||||
FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuName = sku.specSnap || sku.name
|
||||
FormData.proGroupVo[proGroupVoIndex].goods[proGroupVoGoodsIndex].skuId = sku.id
|
||||
proGroupVoIndex = undefined
|
||||
|
|
@ -916,7 +918,7 @@
|
|||
|
||||
function proGroupVoAddGoods(index, arr) {
|
||||
proGroupVoIndex = index
|
||||
if(!FormData.proGroupVo){
|
||||
if (!FormData.proGroupVo) {
|
||||
initDefaultProGroupVo()
|
||||
}
|
||||
if (FormData.groupType == 0) {
|
||||
|
|
@ -945,7 +947,6 @@
|
|||
}
|
||||
|
||||
function refChooseGoodsConfirm(arr) {
|
||||
console.log(arr);
|
||||
refChooseGoodsClose()
|
||||
arr = arr.map(v => {
|
||||
const {
|
||||
|
|
@ -974,10 +975,8 @@
|
|||
skuName: ''
|
||||
}
|
||||
})
|
||||
console.log(arr);
|
||||
console.log(FormData.groupType);
|
||||
|
||||
if (FormData.groupType == 0) {
|
||||
console.log(FormData.proGroupVo[0]);
|
||||
return FormData.proGroupVo[0].goods = arr
|
||||
}
|
||||
if (FormData.groupType == 1 && proGroupVoIndex !== undefined) {
|
||||
|
|
@ -1230,13 +1229,13 @@
|
|||
//表单边框
|
||||
const inputBorder = ref(false)
|
||||
const FormData = reactive({
|
||||
days: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
days: "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
|
||||
endTime: "23:59",
|
||||
startTime: "00:00",
|
||||
//每日销量上限,
|
||||
dayLimit: 0,
|
||||
singleOrderLimit:0,
|
||||
singlePeopleLimit:0,
|
||||
singleOrderLimit: 0,
|
||||
singlePeopleLimit: 0,
|
||||
type: 'normal',
|
||||
showType: ['table'],
|
||||
specsInfoName: '',
|
||||
|
|
@ -1364,7 +1363,7 @@
|
|||
res.specsInfoName = specsInfoName
|
||||
$goodsData = res
|
||||
skuList.list = res.skuList
|
||||
res.showType=res.showType.split(',')
|
||||
res.showType = res.showType.split(',')
|
||||
Object.assign(FormData, res)
|
||||
//多规格
|
||||
if (res.typeEnum === 'sku') {
|
||||
|
|
@ -1572,6 +1571,12 @@
|
|||
getTbShopUnit()
|
||||
getTbProductSpec()
|
||||
})
|
||||
const changeFormDatatype = (e) => {
|
||||
console.log(e)
|
||||
console.log(FormData)
|
||||
// 当是称重商品时 默认是单规格
|
||||
FormData.typeEnum = 'normal'
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
// if (option.type === 'edit') {
|
||||
|
|
@ -1685,7 +1690,7 @@
|
|||
}
|
||||
}
|
||||
if (type == 'package') {
|
||||
if (groupType == 0&& FormData.proGroupVo[0].goods.length<=0) {
|
||||
if (groupType == 0 && FormData.proGroupVo[0].goods.length <= 0) {
|
||||
// 固定套餐
|
||||
return infoBox.showToast('套餐组合至少需要包含一种商品,请添加商品')
|
||||
}
|
||||
|
|
@ -1693,6 +1698,7 @@
|
|||
let ispase = FormData.proGroupVo.length > 0 ? true : false
|
||||
let tips = ispase ? '' : '请添加至少一种套餐'
|
||||
for (let i in FormData.proGroupVo) {
|
||||
FormData.proGroupVo[i].count = FormData.proGroupVo[i].goods.length
|
||||
const item = FormData.proGroupVo[i]
|
||||
if (item.goods.length <= 0) {
|
||||
ispase = false
|
||||
|
|
@ -1718,7 +1724,7 @@
|
|||
}
|
||||
const submitData = {
|
||||
...FormData,
|
||||
showType:FormData.showType.join(','),
|
||||
showType: FormData.showType.join(','),
|
||||
proGroupVo: type != 'package' ? '' : FormData.proGroupVo,
|
||||
images: images,
|
||||
coverImg: images[0] || '',
|
||||
|
|
@ -1744,6 +1750,19 @@
|
|||
})
|
||||
})
|
||||
}
|
||||
// 如果套餐没选择规格,默认选中第一条
|
||||
console.log(submitData.proGroupVo)
|
||||
if (submitData.proGroupVo) {
|
||||
submitData.proGroupVo.forEach((res, index) => {
|
||||
submitData.proGroupVo[index].goods.forEach(ele => {
|
||||
if (!ele.skuId) {
|
||||
ele.skuId = ele.skuList[0].id
|
||||
ele.skuName = ele.skuList[0].specSnap || ele.skuList[0].name
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
submitData.selectSpec =
|
||||
$addProduct(submitData).then(res => {
|
||||
infoBox.showSuccessToast('添加成功')
|
||||
|
|
@ -1767,7 +1786,6 @@
|
|||
return result.replace(/.$/, "")
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* 监听规格保存,拿到数据
|
||||
*/
|
||||
|
|
@ -1931,14 +1949,14 @@
|
|||
watch(() => FormData.type, (newval) => {
|
||||
if (option.type == 'edit') {
|
||||
if (newval == $goodsData.type) {
|
||||
if($goodsData.proGroupVo){
|
||||
FormData.proGroupVo = $goodsData.proGroupVo||[]
|
||||
}else{
|
||||
if ($goodsData.proGroupVo) {
|
||||
FormData.proGroupVo = $goodsData.proGroupVo || []
|
||||
} else {
|
||||
initDefaultProGroupVo()
|
||||
}
|
||||
}
|
||||
if(FormData.groupType==null){
|
||||
FormData.groupType=0
|
||||
if (FormData.groupType == null) {
|
||||
FormData.groupType = 0
|
||||
}
|
||||
} else {
|
||||
if (newval == 'package') {
|
||||
|
|
@ -2005,11 +2023,22 @@
|
|||
disabledChangeCategory.value = !res
|
||||
}
|
||||
}
|
||||
|
||||
const activeinHouseList = computed(() => {
|
||||
try {
|
||||
return pageData.units.filter((item) => {
|
||||
if (item.id == FormData.unitId) {
|
||||
return item.name
|
||||
}
|
||||
})[0].name
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 权限end
|
||||
*/
|
||||
|
||||
|
||||
watch(() => pageData.types, (newval) => {
|
||||
Forms.value.setRules(rules)
|
||||
})
|
||||
|
|
@ -2020,6 +2049,7 @@
|
|||
onReady(() => {
|
||||
Forms.value && Forms.value.setRules(rules)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
clearTimeout(timer)
|
||||
})
|
||||
|
|
@ -2133,7 +2163,8 @@
|
|||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
::v-deep .typeEnum .u-checkbox-group--row{
|
||||
|
||||
::v-deep .typeEnum .u-checkbox-group--row {
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@
|
|||
const hour = times.value[0][indexArr[0]]
|
||||
const month = times.value[1][indexArr[1]]
|
||||
const s = times.value[2][indexArr[2]]
|
||||
return `${hour}:${month}:${s}`
|
||||
// return `${hour}:${month}:${s}`
|
||||
return `${hour}:${month}`
|
||||
}
|
||||
//获取$event.detail.value
|
||||
function getEnentDetailValue(e) {
|
||||
|
|
@ -152,11 +153,11 @@
|
|||
function returnBasicTimeConstructor() {
|
||||
return {
|
||||
startTime: {
|
||||
value: '00:00:00',
|
||||
value: '00:00',
|
||||
index: [0, 0, 0]
|
||||
},
|
||||
endTime: {
|
||||
value: '00:00:00',
|
||||
value: '23:59',
|
||||
index: [0, 0, 0]
|
||||
}
|
||||
}
|
||||
|
|
@ -190,13 +191,13 @@
|
|||
}
|
||||
// 触发定时器保存事件将数据给到添加商品页面
|
||||
function emitTimerSave() {
|
||||
const par={
|
||||
days:list.value[0].cycleChecked.join(','),
|
||||
startTime:list.value[0].startTime.value,
|
||||
endTime:list.value[0].endTime.value
|
||||
const par = {
|
||||
days: list.value[0].cycleChecked.join(','),
|
||||
startTime: list.value[0].startTime.value,
|
||||
endTime: list.value[0].endTime.value
|
||||
}
|
||||
console.log(par);
|
||||
uni.$emit('timerSave',par)
|
||||
uni.$emit('timerSave', par)
|
||||
go.back()
|
||||
}
|
||||
|
||||
|
|
@ -207,14 +208,14 @@
|
|||
|
||||
function returnTimeIndex(time) {
|
||||
console.log(time);
|
||||
return time.split(':').map(v=>{
|
||||
return v*1
|
||||
return time.split(':').map(v => {
|
||||
return v * 1
|
||||
})
|
||||
}
|
||||
|
||||
function returnTimer(res) {
|
||||
return [{
|
||||
cycleChecked: res.days ? res.days.split(',').filter(v=>v) : [],
|
||||
cycleChecked: res.days ? res.days.split(',').filter(v => v) : [],
|
||||
startTime: res.startTime ? {
|
||||
value: res.startTime,
|
||||
index: returnTimeIndex(res.startTime)
|
||||
|
|
|
|||
97
pages.json
97
pages.json
|
|
@ -8,8 +8,7 @@
|
|||
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
|
||||
}
|
||||
},
|
||||
"pages": [
|
||||
{
|
||||
"pages": [{
|
||||
"pageId": "PAGES_INDEX",
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
|
|
@ -760,13 +759,28 @@
|
|||
{
|
||||
"root": "pageBwc",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_BWC",
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "霸王餐"
|
||||
}
|
||||
"pageId": "PAGES_BWC",
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "霸王餐"
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"root": "pagewriteoff",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_WEITEOFF",
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "核销列表"
|
||||
}
|
||||
}, {
|
||||
"pageId": "PAGES_WEITEOFF_RECORD",
|
||||
"path": "index/record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "核销记录"
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"root": "pageBooking",
|
||||
|
|
@ -877,11 +891,10 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"path" : "quan/quan",
|
||||
"path": "quan/quan",
|
||||
"pageId": "PAGES_ORDER_QUAN",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "券包"
|
||||
"style": {
|
||||
"navigationBarTitleText": "券包"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1094,44 +1107,42 @@
|
|||
{
|
||||
"root": "pageNotification",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_NOTIFICATION_INDEX",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订阅通知"
|
||||
}
|
||||
"pageId": "PAGES_NOTIFICATION_INDEX",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订阅通知"
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
"root": "pageCreditBuyer",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_CREDIT_BUYER_INDEX",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "挂账管理"
|
||||
}
|
||||
},{
|
||||
"pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR",
|
||||
"path": "addDebtor",
|
||||
"style": {
|
||||
"navigationBarTitleText": "挂账人"
|
||||
}
|
||||
},{
|
||||
"pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD",
|
||||
"path": "rePaymentRecord",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账单付款记录"
|
||||
}
|
||||
},{
|
||||
"pageId": "PAGES_CREDIT_BUYER_DETAIL",
|
||||
"path": "creditDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "查看明细"
|
||||
}
|
||||
"pageId": "PAGES_CREDIT_BUYER_INDEX",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "挂账管理"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"pageId": "PAGES_CREDIT_BUYER_ADDDEBTOR",
|
||||
"path": "addDebtor",
|
||||
"style": {
|
||||
"navigationBarTitleText": "挂账人"
|
||||
}
|
||||
}, {
|
||||
"pageId": "PAGES_CREDIT_BUYER_REPAYMENTRECORD",
|
||||
"path": "rePaymentRecord",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账单付款记录"
|
||||
}
|
||||
}, {
|
||||
"pageId": "PAGES_CREDIT_BUYER_DETAIL",
|
||||
"path": "creditDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "查看明细"
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
"globalStyle": {
|
||||
"navigationBarTextStyle": "black",
|
||||
|
|
|
|||
|
|
@ -284,8 +284,11 @@
|
|||
// pageUrl: 'PAGES_RED_INDEX',
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
|
||||
|
||||
{
|
||||
title: '核销管理',
|
||||
icon: '/static/indexImg/pagewriteoff.svg',
|
||||
pageUrl: 'PAGES_WEITEOFF'
|
||||
},
|
||||
{
|
||||
title: '退出登录',
|
||||
icon: '/static/indexImg/icon-login-out.svg',
|
||||
|
|
@ -373,6 +376,7 @@
|
|||
/* #endif */
|
||||
/* #ifndef H5 */
|
||||
padding-top: calc(84rpx + 44px);
|
||||
|
||||
/* #endif */
|
||||
>view {
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</image>
|
||||
</view>
|
||||
<view class="u-m-l-30 u-m-r-30 color-333">
|
||||
{{item.number}}
|
||||
{{(item.number).toFixed(2)}}
|
||||
</view>
|
||||
<view class="u-flex" @tap="updateNumber(true,index,item)">
|
||||
<image src="/pagesCreateOrder/static/images/icon-add-black.svg" class="icon" mode="">
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
<template>
|
||||
<view class="u-relative u-flex item">
|
||||
|
||||
<up-image :src="data.coverImg" mode="aspectFill" :width="img.width" :height="img.height"></up-image>
|
||||
|
||||
<up-image :src="data.coverImg" mode="aspectFill" :width="img.width" :height="img.height"></up-image>
|
||||
<!-- <image lazy-load class="img" :src="data.coverImg" mode="aspectFill" :style="computedImgStyle()"></image> -->
|
||||
<view class="info u-flex u-row-between u-col-top u-flex-col" >
|
||||
<view class="info u-flex u-row-between u-col-top u-flex-col">
|
||||
<view>
|
||||
<view>
|
||||
<text class="u-line-2">{{data.name}}
|
||||
</text>
|
||||
<text class="u-line-2">{{data.name}}
|
||||
</text>
|
||||
</view>
|
||||
<view class="u-font-32 font-bold u-m-t-16">
|
||||
¥{{data.price}}
|
||||
</view>
|
||||
<template v-if="data.type=='weigh'">
|
||||
<view class="btnweigh">称重</view>
|
||||
</template>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<template v-if="!isSellout">
|
||||
|
|
@ -20,12 +23,12 @@
|
|||
</template>
|
||||
<template v-else>
|
||||
<view class="u-flex icon-btn">
|
||||
<view class="u-flex" @tap.stop="emitEvent('add')">
|
||||
<view class="u-flex" @tap.stop="emitEvent(data.type=='weigh'?'tapweigh':'add')">
|
||||
<image src="/pagesCreateOrder/static/images/icon-add.svg" class="icon" mode=""></image>
|
||||
</view>
|
||||
<template v-if="data.chooseNumber">
|
||||
<view class="u-font-32">
|
||||
{{data.chooseNumber}}
|
||||
{{(data.chooseNumber).toFixed(2)}}
|
||||
</view>
|
||||
<view class="u-flex" @tap.stop="emitEvent('reduce')">
|
||||
<image src="/pagesCreateOrder/static/images/icon-reduce.svg" class="icon" mode="">
|
||||
|
|
@ -56,20 +59,20 @@
|
|||
} from 'vue';
|
||||
import util from '../util.js';
|
||||
const props = defineProps({
|
||||
img:{
|
||||
type:Object,
|
||||
default:{
|
||||
width:'250rpx',
|
||||
height:'272rpx'
|
||||
img: {
|
||||
type: Object,
|
||||
default: {
|
||||
width: '250rpx',
|
||||
height: '272rpx'
|
||||
}
|
||||
},
|
||||
index: {
|
||||
type: [Number,String],
|
||||
type: [Number, String],
|
||||
},
|
||||
isSeatFee:{
|
||||
isSeatFee: {
|
||||
//是否为餐位费
|
||||
type:Boolean,
|
||||
default:false
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
data: {
|
||||
type: Object,
|
||||
|
|
@ -80,36 +83,36 @@
|
|||
}
|
||||
}
|
||||
})
|
||||
|
||||
function computedImgStyle(){
|
||||
|
||||
function computedImgStyle() {
|
||||
return {
|
||||
width:props.img.width,
|
||||
height:props.img.height
|
||||
width: props.img.width,
|
||||
height: props.img.height
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//判断是否是菜品
|
||||
function isGoods(){
|
||||
function isGoods() {
|
||||
return props.data.hasOwnProperty('id')
|
||||
}
|
||||
|
||||
|
||||
//判断商品是否售尽
|
||||
const isSellout = computed(() => {
|
||||
const item = props.data
|
||||
if(!isGoods()){
|
||||
if (!isGoods()) {
|
||||
return false
|
||||
}
|
||||
return (
|
||||
item.isPauseSale ||
|
||||
(item.typeEnum !== "sku" && item.isStock==1&& item.stockNumber <= 0)
|
||||
(item.typeEnum !== "sku" && item.isStock == 1 && item.stockNumber <= 0)
|
||||
);
|
||||
})
|
||||
|
||||
|
||||
const emits = defineEmits(['add', 'reduce', 'chooseGuige'])
|
||||
|
||||
function emitEvent(emitName){
|
||||
if(isGoods()){
|
||||
const emits = defineEmits(['add', 'reduce', 'chooseGuige','tapweigh'])
|
||||
|
||||
function emitEvent(emitName) {
|
||||
if (isGoods()) {
|
||||
emits(emitName, props.index)
|
||||
}
|
||||
}
|
||||
|
|
@ -134,10 +137,24 @@
|
|||
color: #fff;
|
||||
}
|
||||
|
||||
.btnweigh {
|
||||
margin: 5rpx 0;
|
||||
width: 100rpx;
|
||||
background: linear-gradient(124deg, #73c969 6%, #27921b 93%);
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 6rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-hover-class {
|
||||
opacity: .6;
|
||||
}
|
||||
image{will-change: transform}
|
||||
|
||||
image {
|
||||
will-change: transform
|
||||
}
|
||||
|
||||
.item {
|
||||
// width: 250rpx;
|
||||
// height: 272rpx;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
style="color:#999">({{item.count}}选{{item.number}})</text> </view>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-20 u-flex-wrap">
|
||||
<view class="item" @tap="chooseSkd(skd,item.number)" :class="{active:skd.select==true}"
|
||||
<view class="item" @tap="chooseSkd(skd,item)" :class="{active:skd.select==true}"
|
||||
v-for="(skd,skdIndex) in item.goods" :key="skdIndex">
|
||||
{{skd.proName}}
|
||||
</view>
|
||||
|
|
@ -62,7 +62,6 @@
|
|||
title: "",
|
||||
price: "",
|
||||
skus: [],
|
||||
selectData: [],
|
||||
// 几选几,的和
|
||||
selectNumber: 0,
|
||||
})
|
||||
|
|
@ -80,6 +79,9 @@
|
|||
// return props.skuMap[selSku.value]
|
||||
// })
|
||||
watch(() => props.goodsData, (newval) => {
|
||||
newval.proGroupVo.forEach(ele => {
|
||||
ele.selectData = []
|
||||
})
|
||||
datas.item = newval
|
||||
datas.title = newval.name
|
||||
datas.price = newval.price
|
||||
|
|
@ -90,22 +92,23 @@
|
|||
})
|
||||
|
||||
const emits = defineEmits(['confirm', 'updateSku'])
|
||||
let number = ref(1)
|
||||
|
||||
function chooseSkd(skd, number) {
|
||||
if (datas.selectData.includes(skd.proId)) {
|
||||
function chooseSkd(skd, item) {
|
||||
if (item.selectData.includes(skd.proId)) {
|
||||
skd.select = false
|
||||
let indexs = datas.selectData.indexOf(skd.proId)
|
||||
datas.selectData.splice(indexs, 1)
|
||||
let indexs = item.selectData.indexOf(skd.proId)
|
||||
item.selectData.splice(indexs, 1)
|
||||
} else {
|
||||
if (datas.selectData.length < number) {
|
||||
if (item.selectData.length < item.number) {
|
||||
skd.select = true
|
||||
datas.selectData.push(skd.proId)
|
||||
item.selectData.push(skd.proId)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const model = ref(null)
|
||||
|
||||
function open() {
|
||||
|
|
@ -118,10 +121,13 @@
|
|||
const instance = getCurrentInstance();
|
||||
|
||||
function confirm() {
|
||||
console.log(datas.selectData.length)
|
||||
console.log(datas.selectNumber,'调试1111')
|
||||
if (datas.selectData.length == datas.selectNumber) {
|
||||
emits('confirm', datas.selectData,datas.item)
|
||||
// 将数据保存进对应的值
|
||||
let arr = []
|
||||
datas.item.proGroupVo.forEach(ele => {
|
||||
arr.push(...ele.selectData)
|
||||
})
|
||||
if (arr.length == datas.selectNumber) {
|
||||
emits('confirm', arr, datas.item)
|
||||
close()
|
||||
} else {
|
||||
instance.ctx.$refs.popup.open()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,290 @@
|
|||
<template>
|
||||
<view class="">
|
||||
<up-overlay :show="overlayshow" @click="overlayshow = false">
|
||||
<view class="boxoverlay">
|
||||
<view class="rect" @tap.stop>
|
||||
<view class="title">
|
||||
<view>
|
||||
标题
|
||||
</view>
|
||||
<view class="" @click="overlayshow = false">
|
||||
<up-icon name="close" color="#93969b" size="20"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inputtop">
|
||||
<view class="dj">
|
||||
<view class="text">单价</view>
|
||||
<view class="jg">¥{{form.goods.lowPrice}}/{{form.goods.unitName}}</view>
|
||||
</view>
|
||||
<view class="inputdj">
|
||||
<view>重量</view>
|
||||
<view class="inputdjbox">
|
||||
<view class="inputdisplay">{{ currentInput }}</view>
|
||||
<text>{{ form.goods.unitName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="keyboard">
|
||||
<button v-for="(num, index) in numberButtons" :key="index" @click="handleClick(num)">
|
||||
{{ num }}
|
||||
</button>
|
||||
<button @click="deleteLast">←</button>
|
||||
</view>
|
||||
<view class="classmoney">
|
||||
¥ {{ (form.goods.lowPrice * currentInput).toFixed(2) }}
|
||||
</view>
|
||||
<view class="classconfirm" @click="clickconfirm">
|
||||
确认
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
watch,
|
||||
defineExpose,
|
||||
defineEmits
|
||||
} from 'vue';
|
||||
const emit = defineEmits(['refresh'])
|
||||
const currentInput = ref('');
|
||||
|
||||
const numberButtons = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.'];
|
||||
|
||||
const handleClick = (value) => {
|
||||
// 首位不能输入0
|
||||
if (currentInput.value === '') {
|
||||
if (value === '0') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (value === '.' && currentInput.value.indexOf('.') !== -1) {
|
||||
return; // 如果已经存在小数点,不再添加
|
||||
}
|
||||
if (value === '.' && currentInput.value === '') {
|
||||
currentInput.value = '0.';
|
||||
} else {
|
||||
currentInput.value += value;
|
||||
}
|
||||
// 限制小数点后两位
|
||||
const parts = currentInput.value.split('.');
|
||||
if (parts.length > 1 && parts[1].length > 2) {
|
||||
currentInput.value = currentInput.value.slice(0, -1);
|
||||
}
|
||||
};
|
||||
const deleteLast = () => {
|
||||
currentInput.value = currentInput.value.slice(0, -1);
|
||||
};
|
||||
|
||||
const clickconfirm = () => {
|
||||
// 首位不能输入0
|
||||
if (currentInput.value === '') {
|
||||
uni.showToast({
|
||||
title: '请输入',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
emit('weighgoodsUpdate', form.foodsindex, form.index, true, undefined, currentInput.value)
|
||||
overlayshow.value = false
|
||||
}
|
||||
//显示
|
||||
const overlayshow = ref(false);
|
||||
const form = reactive({})
|
||||
const open = (foodsindex, index, goods) => {
|
||||
currentInput.value = ''
|
||||
Object.assign(form, {
|
||||
foodsindex,
|
||||
index,
|
||||
goods
|
||||
})
|
||||
overlayshow.value = true
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.boxoverlay {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.rect {
|
||||
padding: 32rpx 28rpx;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 20rpx;
|
||||
font-size: 40rpx;
|
||||
border-bottom: 1rpx solid #ccc;
|
||||
}
|
||||
|
||||
.inputtop {
|
||||
margin-top: 20rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.dj {
|
||||
width: 32%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
.text {
|
||||
font-weight: 300;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.jg {
|
||||
margin-top: 16rpx;
|
||||
background-color: #e8f4ff;
|
||||
color: #1890ff;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #1890ff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.inputdj {
|
||||
width: 66%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
font-weight: 300;
|
||||
font-size: 24rpx;
|
||||
|
||||
.inputdjbox {
|
||||
margin-top: 16rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border: 1rpx solid #ccc;
|
||||
border-radius: 10rpx;
|
||||
padding-left: 20rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
background: #fff;
|
||||
|
||||
.inputdisplay {
|
||||
width: auto;
|
||||
|
||||
}
|
||||
|
||||
text {
|
||||
border: 1rpx solid #ccc;
|
||||
border-radius: 10rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 20rpx;
|
||||
background: #f5f7fa;
|
||||
color: #a7aaaf;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 28%;
|
||||
margin: 10rpx;
|
||||
}
|
||||
|
||||
.keyboard-button {
|
||||
width: 28%;
|
||||
margin: 10rpx;
|
||||
border: none;
|
||||
border-radius: 5rpx;
|
||||
box-shadow: 0 0 5rpx rgba(0, 0, 0, 0.3), 0 0 10rpx rgba(0, 0, 0, 0.2);
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
// .keyboard-button:hover {
|
||||
// box-shadow: 0 0 10rpx rgba(255, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.3);
|
||||
// transform: translateY(-2rpx);
|
||||
// }
|
||||
|
||||
.dot-button {
|
||||
// background-color: #FFC107;
|
||||
}
|
||||
|
||||
.clear-button {
|
||||
// background-color: #FF5733;
|
||||
}
|
||||
|
||||
.clear-button:hover {
|
||||
box-shadow: 0 0 10px rgba(255, 87, 51, 0.5), 0 0 20px rgba(255, 87, 51, 0.3);
|
||||
}
|
||||
|
||||
.delete-button {
|
||||
// background-color: #33FF57;
|
||||
}
|
||||
|
||||
.delete-button:hover {
|
||||
// box-shadow: 0 0 10px rgba(51, 255, 87, 0.5), 0 0 20px rgba(51, 255, 87, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
.classmoney {
|
||||
margin-top: 16rpx;
|
||||
width: 100%;
|
||||
font-size: 40rpx;
|
||||
text-align: left;
|
||||
color: #ff5152;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.classconfirm {
|
||||
width: 100%;
|
||||
margin: 30rpx auto 0 auto;
|
||||
border-radius: 16rpx;
|
||||
text-align: center;
|
||||
background: #1890ff;
|
||||
color: #fff;
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -78,7 +78,8 @@
|
|||
<view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex">
|
||||
<list-goods-item @chooseGuige="chooseGuige($event,index)"
|
||||
@add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)"
|
||||
:index="goodsIndex" :data="goodsItem"></list-goods-item>
|
||||
@tapweigh="tapweigh($event,index)" :index="goodsIndex"
|
||||
:data="goodsItem"></list-goods-item>
|
||||
|
||||
</view>
|
||||
<!-- <template v-if="item.name==='附加费'">
|
||||
|
|
@ -104,6 +105,7 @@
|
|||
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
|
||||
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
|
||||
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)"
|
||||
@tapweigh="tapweigh(goodsItem.goodsIndex,goodsItem.index)"
|
||||
:index="goodsItem.goodsIndex" :data="goodsItem"></list-goods-item>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -127,8 +129,8 @@
|
|||
:skus="guigeModelData.chooseGoods.skus"></guige-model>
|
||||
<!-- 添加附加费 -->
|
||||
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
||||
|
||||
|
||||
<!-- 称重 -->
|
||||
<weigh-item ref="refweighitem" @weighgoodsUpdate='goodsUpdate'></weigh-item>
|
||||
</view>
|
||||
<up-modal title="提示" content="该台桌购物车里有商品,是否清除该台桌里的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay
|
||||
@confirm="confirmModelConfirm" @cancel="confirmModelConfirm('cancel')" @close="setModalShow('clear',false)"
|
||||
|
|
@ -151,6 +153,7 @@
|
|||
import color from '@/commons/color.js';
|
||||
import guigeModel from './components/guige'
|
||||
import taocanModel from './components/taocanModel.vue'
|
||||
import weighItem from './components/weigh.vue'
|
||||
import listGoodsItem from './components/list-goods-item.vue'
|
||||
import mySurcharge from './components/surcharge'
|
||||
import {
|
||||
|
|
@ -856,6 +859,13 @@
|
|||
|
||||
let selGoods = ref({});
|
||||
|
||||
// 称重
|
||||
const refweighitem = ref(null)
|
||||
const tapweigh = (foodsindex, index) => {
|
||||
const goods = data.tabbar[index].foods[foodsindex]
|
||||
refweighitem.value.open(foodsindex, index, goods)
|
||||
}
|
||||
|
||||
function chooseGuige(foodsindex, index) {
|
||||
if (!canAddGoods()) {
|
||||
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
||||
|
|
@ -987,7 +997,8 @@
|
|||
searchResult.value[index].chooseNumber = chooseNumber
|
||||
}
|
||||
}
|
||||
async function goodsUpdate(foodsindex, index, isAdd, searchGoodsIndex) {
|
||||
|
||||
async function goodsUpdate(foodsindex, index, isAdd, searchGoodsIndex, showCurrentInput) { // showCurrentInput 称重才会传的参数
|
||||
// if (!canAddGoods()) {
|
||||
// return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
||||
// chooseTable()
|
||||
|
|
@ -1001,13 +1012,13 @@
|
|||
});
|
||||
const productId = $goods.id
|
||||
const skuId = $goods.specList[0].id
|
||||
const suit = $goods.specList[0].suit || 1
|
||||
let suit = $goods.specList[0].suit || 1
|
||||
if (goodsInCarIndex !== -1) {
|
||||
//更新
|
||||
const carGoods = cars[goodsInCarIndex]
|
||||
const cartId = carGoods.id
|
||||
const step = isAdd ? 1 : -1
|
||||
const num = carGoods.number * 1 + step
|
||||
let num = carGoods.number * 1 + step
|
||||
if (num === 0 || num < suit) {
|
||||
//移除
|
||||
cars.splice(goodsInCarIndex, 1)
|
||||
|
|
@ -1017,6 +1028,10 @@
|
|||
cartId
|
||||
})
|
||||
}
|
||||
// 不影响之前的代码 称重num单独处理
|
||||
if ($goods.type == 'weigh' && showCurrentInput) {
|
||||
num = carGoods.number * 1 + Number(showCurrentInput)
|
||||
}
|
||||
const {
|
||||
number
|
||||
} = await updateCartGoods({
|
||||
|
|
@ -1029,6 +1044,10 @@
|
|||
$goods.chooseNumber = number
|
||||
setSearchGoods(searchGoodsIndex, number)
|
||||
} else {
|
||||
// 不影响之前的代码 称重suit单独处理
|
||||
if ($goods.type == 'weigh' && showCurrentInput) {
|
||||
suit = showCurrentInput
|
||||
}
|
||||
// 套餐和单规格
|
||||
if ($goods.groupType != 1) {
|
||||
//增加
|
||||
|
|
@ -1039,7 +1058,7 @@
|
|||
skuId
|
||||
})
|
||||
infoBox.showToast('添加成功')
|
||||
$goods.chooseNumber = num
|
||||
$goods.chooseNumber = Number(num)
|
||||
cars.push(cartGoods)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,255 @@
|
|||
<template>
|
||||
<view class="">
|
||||
<up-overlay :show="overlayshow" @click="overlayshow = false">
|
||||
<view class="boxoverlay">
|
||||
<view class="rect" @tap.stop>
|
||||
<!-- 抖音 -->
|
||||
<view class="bottomconstant">
|
||||
<view class="itemlist">
|
||||
<!-- <view class="ordernumber">
|
||||
订单号:111
|
||||
</view> -->
|
||||
<view class="title">
|
||||
请选择商品
|
||||
</view>
|
||||
<view class="itemlists" v-for="(item,index) in form.goods" :key="index">
|
||||
<view class="top">
|
||||
<view class="tag">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="date">
|
||||
¥{{item.amount}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bottom">
|
||||
核销
|
||||
</view> -->
|
||||
<view v-if="item.type" @click="item.type =!item.type">
|
||||
<up-icon name="checkmark-circle" color="#2979ff" size="22"></up-icon>
|
||||
</view>
|
||||
<view class="icon" v-else @click="item.type =!item.type"></view>
|
||||
</view>
|
||||
<view class="bouttonbox">
|
||||
<view class="keep" @click="confirms">
|
||||
确定核销
|
||||
</view>
|
||||
<view class="cancel" @click="overlayshow = false">
|
||||
取消
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
watch,
|
||||
defineExpose
|
||||
} from 'vue';
|
||||
const form = reactive({
|
||||
id: "",
|
||||
number: '',
|
||||
sum_pay_amount: '',
|
||||
goods: [],
|
||||
verify_token: '',
|
||||
});
|
||||
import {
|
||||
certificateprepares
|
||||
} from '@/http/php/api.ts';
|
||||
|
||||
//显示
|
||||
const overlayshow = ref(false);
|
||||
const open = (val) => {
|
||||
Object.assign(form, val)
|
||||
form.goods.map((item) => {
|
||||
item.type = true
|
||||
})
|
||||
overlayshow.value = true
|
||||
}
|
||||
let confirms = async () => {
|
||||
// 判断是否选择商品
|
||||
if (form.goods.filter(i => i.type).length == 0) {
|
||||
uni.showToast({
|
||||
title: '请选择商品',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
let data = null
|
||||
if (uni.getStorageSync('clint_type') == 1) {
|
||||
data = {
|
||||
couponCode: form.couponCode,
|
||||
num: form.goods.length
|
||||
}
|
||||
} else {
|
||||
let encrypted_codes = form.goods.filter(i => i.type).map((obj, index) => {
|
||||
return obj.encrypted_code;
|
||||
})
|
||||
data = {
|
||||
verify_token: form.verify_token,
|
||||
encrypted_codes: encrypted_codes.toString(),
|
||||
id: form.id
|
||||
}
|
||||
}
|
||||
await certificateprepares(data)
|
||||
uni.showToast({
|
||||
title: '验证成功',
|
||||
icon: 'none'
|
||||
})
|
||||
overlayshow.value = false
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.boxoverlay {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.rect {
|
||||
padding: 32rpx 28rpx;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.bottomconstant {
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.itemlist:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.itemlist {
|
||||
// margin-top: 16rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.ordernumber {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-top: 16rpx;
|
||||
padding-bottom: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
}
|
||||
|
||||
.itemlists {
|
||||
padding-top: 16rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
.date {
|
||||
margin-top: 10rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.tag {
|
||||
width: 350rpx;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border: 1px solid #909399;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background: #EAF4FD;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #318AFE;
|
||||
}
|
||||
}
|
||||
|
||||
.bouttonbox {
|
||||
margin-top: 80rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.keep {
|
||||
width: 490rpx;
|
||||
height: 80rpx;
|
||||
background: #318AFE;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.cancel {
|
||||
text-align: center;
|
||||
width: 490rpx;
|
||||
height: 80rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
<template>
|
||||
<view class="">
|
||||
<up-overlay :show="overlayshow" @click="overlayshow = false">
|
||||
<view class="boxoverlay">
|
||||
<view class="rect" @tap.stop>
|
||||
<!-- 抖音 -->
|
||||
<view class="bottomconstant">
|
||||
<view class="itemlist">
|
||||
<!-- <view class="ordernumber">
|
||||
订单号:111
|
||||
</view> -->
|
||||
<view class="title">
|
||||
绑定门店
|
||||
</view>
|
||||
<view class="itemlists" v-for="(item,index) in 4" :key="index">
|
||||
<view class="top">
|
||||
<view class="tag">
|
||||
名称qqqqqqqqq
|
||||
</view>
|
||||
<view class="date">
|
||||
地址:qqqqqqq
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
操作
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
watch,
|
||||
defineExpose
|
||||
} from 'vue';
|
||||
//显示
|
||||
const overlayshow = ref(false);
|
||||
const open = () => {
|
||||
overlayshow.value = true
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.boxoverlay {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.rect {
|
||||
padding: 32rpx 28rpx;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.bottomconstant {
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.itemlist:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.itemlist {
|
||||
// margin-top: 16rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.ordernumber {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-top: 16rpx;
|
||||
padding-bottom: 16rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
}
|
||||
|
||||
.itemlists {
|
||||
padding-top: 16rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
.date {
|
||||
margin-top: 10rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.tag {
|
||||
width: 350rpx;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
background: #EAF4FD;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #318AFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
<template>
|
||||
<view class="constant">
|
||||
<view class="constantitem" @click="object_id =null,overlayshow = true">
|
||||
<view>扫码核销</view>
|
||||
<view>
|
||||
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="constantitem" @click="clickpath('PAGES_WEITEOFF_RECORD',1)">
|
||||
<view>美团记录</view>
|
||||
<view>
|
||||
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="constantitem" @click="clickpath('PAGES_WEITEOFF_RECORD',2)">
|
||||
<view>抖音记录</view>
|
||||
<view>
|
||||
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 核销准备 -->
|
||||
<up-overlay :show="overlayshow">
|
||||
<view class="boxoverlay">
|
||||
<view class="rect" @tap.stop>
|
||||
<view class="top">
|
||||
团购卷核销
|
||||
</view>
|
||||
<view class="subsection">
|
||||
<up-subsection :list="subsectionlist" :current="subsectioncurrent" @change="sectionChange">
|
||||
</up-subsection>
|
||||
</view>
|
||||
<view class="search">
|
||||
<up-search :show-action="false" searchIcon="scan" :clearabled="true" @clickIcon='clickIcon'
|
||||
placeholder="请扫码或者输入卷码" v-model="object_id"></up-search>
|
||||
</view>
|
||||
<view class="search">
|
||||
<up-alert fontSize='10' :show-icon="true" title="请使用相机识别扫码" type="warning"
|
||||
:closable="true"></up-alert>
|
||||
</view>
|
||||
<view class="bouttonbox">
|
||||
<view class="keep" @click="confirms">
|
||||
确认
|
||||
</view>
|
||||
<view class="cancel" @click="overlayshow = false">
|
||||
取消
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
<!-- 绑定门店 -->
|
||||
<dialogs ref="dialogsref"></dialogs>
|
||||
<!-- 选择商品 -->
|
||||
<commodity ref="refcommodity"></commodity>
|
||||
<!-- 二维码 -->
|
||||
<up-overlay :show="qrcodes.show" @click="qrcodes.show = false">
|
||||
<view class="boxoverlay">
|
||||
<view class="rect" @tap.stop
|
||||
style="display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
||||
<!-- <view>{{subsectioncurrent==0?'请用美团':'抖音'}}</view> -->
|
||||
<view style="padding-bottom:40rpx;font-weight: 600;">请进行手机扫码</view>
|
||||
<!-- <up-qrcode :size="200" :val="qrcodes.val" :icon='qrcodes.icon'></up-qrcode> -->
|
||||
<up-qrcode :size="200" :val="qrcodes.val"></up-qrcode>
|
||||
</view>
|
||||
</view>
|
||||
</up-overlay>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onUnload,
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
userlogout,
|
||||
douyincheckIn,
|
||||
fulfilmentcertificateprepare, //准备核销
|
||||
searchstorestatus, //状态查询
|
||||
getuisdk //获取uisdk 绑定 链接
|
||||
} from '@/http/php/api.ts';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import dialogs from '../components/dialogs.vue'
|
||||
import commodity from '../components/commodity.vue'
|
||||
onLoad(async () => {
|
||||
// 登录 会员入签
|
||||
let res = await douyincheckIn({
|
||||
token: uni.getStorageSync("iToken"),
|
||||
loginName: uni.getStorageSync("shopId"),
|
||||
clientType: 'ADMIN'
|
||||
})
|
||||
uni.setStorageSync('phpuserinfo', res.userInfo)
|
||||
uni.setStorageSync('clint_type', 1)
|
||||
})
|
||||
//显示
|
||||
const overlayshow = ref(false);
|
||||
|
||||
// 切换
|
||||
const subsectioncurrent = ref(0);
|
||||
const subsectionlist = ref(['美团', '抖音']);
|
||||
const sectionChange = (index) => {
|
||||
subsectioncurrent.value = index;
|
||||
uni.setStorageSync('clint_type', index + 1)
|
||||
|
||||
}
|
||||
// 二维码或者条形码
|
||||
const object_id = ref(null)
|
||||
// 扫码
|
||||
const clickIcon = () => {
|
||||
uni.scanCode({ // 允许从相机和相册扫码
|
||||
success: (res) => {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
object_id.value = res.result
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 二维码
|
||||
const qrcodes = reactive({
|
||||
val: 'www.baidu.com',
|
||||
icon: '@/static/logo.png',
|
||||
show: false
|
||||
})
|
||||
|
||||
// 首先获取状态
|
||||
let confirms = async () => {
|
||||
if (object_id.value == null) {
|
||||
uni.showToast({
|
||||
title: '请扫码或者输入卷码',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
let res = await searchstorestatus()
|
||||
// status == 0 则需要显示二维码 ==1 去核销
|
||||
if (res.status == 0) {
|
||||
qrcodes.val = await getuisdk()
|
||||
overlayshow.value = false
|
||||
qrcodes.show = true
|
||||
} else {
|
||||
clickkeep()
|
||||
}
|
||||
}
|
||||
// 点击确定
|
||||
const clickkeep = async () => {
|
||||
let data = null
|
||||
if (uni.getStorageSync('clint_type') == 1) {
|
||||
data = {
|
||||
code: object_id.value
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
object_id: object_id.value
|
||||
}
|
||||
}
|
||||
let res = await fulfilmentcertificateprepare(data)
|
||||
overlayshow.value = false
|
||||
refcommodity.value.open(res)
|
||||
}
|
||||
// 这是选择门店
|
||||
// const dialogsref = ref(null)
|
||||
// const dialogconfirm = () => {
|
||||
// dialogsref.value.open()
|
||||
// }
|
||||
// 选择商品
|
||||
const refcommodity = ref(null)
|
||||
// 跳转
|
||||
const clickpath = (URL, title) => {
|
||||
uni.setStorageSync('clint_type', title)
|
||||
go.to(URL)
|
||||
}
|
||||
|
||||
onShow(async () => {})
|
||||
|
||||
// 销毁组件
|
||||
onUnload(async () => {
|
||||
// 退出
|
||||
await userlogout()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.constant {
|
||||
.constantitem {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
padding: 24rpx 32rpx;
|
||||
}
|
||||
|
||||
.boxoverlay {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.rect {
|
||||
padding: 32rpx 28rpx;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.top {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.subsection {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.search {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.bouttonbox {
|
||||
margin-top: 80rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.keep {
|
||||
width: 490rpx;
|
||||
height: 80rpx;
|
||||
background: #318AFE;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.cancel {
|
||||
text-align: center;
|
||||
width: 490rpx;
|
||||
height: 80rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 40rpx 40rpx 40rpx 40rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,360 @@
|
|||
<template>
|
||||
<view class="constant">
|
||||
<!-- <view class="topbox">
|
||||
<view class="left">
|
||||
<view class="">
|
||||
筛选
|
||||
</view>
|
||||
<view class=""></view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<up-input class="input" placeholder="搜索订单号" v-model="value"
|
||||
@change="change"></up-input>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 抖音 -->
|
||||
<view v-if="form.type == 2">
|
||||
<view class="bottomconstant" v-for="(item,index) in form.list" :key="index">
|
||||
<view class="itemlist">
|
||||
<view class="ordernumber">
|
||||
{{item.d_order_id}}
|
||||
</view>
|
||||
<view class="title">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="itemlists" v-for="(item1,index1) in item.douyinCodeGoods" :key="item1.id">
|
||||
<view class="top">
|
||||
<view class="date">
|
||||
{{item1.create_time}}
|
||||
</view>
|
||||
<view class="tag" v-if="item1.status == 1" @click="clickcancel(item1)"
|
||||
style="background: #318AFE;color: #fff; border-radius: 10rpx;">
|
||||
撤销核销
|
||||
</view>
|
||||
<view class="tag" v-if="item1.status == 0">
|
||||
等待验券
|
||||
</view>
|
||||
<view class="tag" v-if="item1.status == 2">
|
||||
失败
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="bottomtitle">
|
||||
{{item1.title}}
|
||||
</view>
|
||||
<view class="price">
|
||||
<view class="prices">
|
||||
{{item1.pay_amount}}
|
||||
</view>
|
||||
<!-- <view class="pricees">
|
||||
{{item1.market_price}}
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 美团 -->
|
||||
<view class="bottomconstant" v-else>
|
||||
<view class="itemlist" v-for="(item,index) in form.list" :key="index">
|
||||
<view class="itemlists" style="padding: 0;">
|
||||
<view class="top">
|
||||
<view class="date">
|
||||
{{item.couponUseTime}}
|
||||
</view>
|
||||
<view class="tag" :style="!item.type?'background: #318AFE;color: #fff; border-radius: 10rpx;':''"
|
||||
@click="clickcancel(item)">
|
||||
{{item.type ? item.couponStatusDesc:'撤销核销'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<view class="bottomtitle">
|
||||
{{item.dealTitle}}
|
||||
</view>
|
||||
<view class="price">
|
||||
<view class="prices">
|
||||
¥{{item.couponBuyPrice}}
|
||||
</view>
|
||||
<!-- <view class="pricees">
|
||||
156
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-loadmore :status="form.status" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
orderlist,
|
||||
fulfilmentcertificatecanceles
|
||||
} from '@/http/php/api.ts';
|
||||
// 下拉加载
|
||||
onReachBottom(() => {
|
||||
if (form.status != 'nomore') {
|
||||
form.page = ++form.page;
|
||||
getlist()
|
||||
}
|
||||
})
|
||||
onLoad(async (e) => {
|
||||
form.type = uni.getStorageSync('clint_type')
|
||||
initial()
|
||||
})
|
||||
const dropdownvalue = ref(1)
|
||||
const optionsdropdown = [{
|
||||
label: '等待验证',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '成功',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '失败',
|
||||
value: 3,
|
||||
}
|
||||
]
|
||||
// 初始化
|
||||
const initial = () => {
|
||||
form.page = 1
|
||||
form.status = 'loadmore'
|
||||
form.d_order_id = ''
|
||||
form.querystatus = ''
|
||||
getlist()
|
||||
}
|
||||
//
|
||||
const form = reactive({
|
||||
type: '',
|
||||
d_order_id: '',
|
||||
querystatus: '',
|
||||
page: 1,
|
||||
status: '',
|
||||
list: [],
|
||||
count: '',
|
||||
date: ''
|
||||
});
|
||||
const getlist = async () => {
|
||||
let data = null
|
||||
if (uni.getStorageSync('clint_type') == 1) {
|
||||
data = {
|
||||
page: form.page,
|
||||
date: form.date
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
page: form.page,
|
||||
status: form.querystatus,
|
||||
d_order_id: form.d_order_id
|
||||
}
|
||||
}
|
||||
let res = await orderlist(data)
|
||||
|
||||
form.count = res.count
|
||||
form.status = 'loading';
|
||||
if (form.page == 1 && res.list.length == 0) {
|
||||
form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
if (form.page == 1) {
|
||||
form.list = res.list
|
||||
} else {
|
||||
form.list = [...form.list, ...res.list];
|
||||
}
|
||||
if (form.list.length >= form.count && res.list.length < 10) {
|
||||
form.status = 'nomore';
|
||||
} else {
|
||||
form.status = 'loadmore';
|
||||
}
|
||||
// 这是美团处理的数据
|
||||
if (uni.getStorageSync('clint_type') == 1) {
|
||||
form.list = form.list.map(item => {
|
||||
// 计算60天后
|
||||
item.couponUseTimes = dayjs(item.couponUseTime).add(60, 'day').format(
|
||||
'YYYY-MM-DD HH:mm:ss')
|
||||
item.type = dayjs().isAfter(dayjs(item.couponUseTime).add(60, 'day'),
|
||||
'year')
|
||||
return item
|
||||
});
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
const clickcancel = async (item) => {
|
||||
uni.showModal({
|
||||
title: '确认撤销吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
let data = null
|
||||
if (uni.getStorageSync('clint_type') == 1) {
|
||||
data = {
|
||||
couponCode: item.couponCode
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
verify_id: item.verify_id,
|
||||
certificate_id: item.certificate_id
|
||||
}
|
||||
}
|
||||
await fulfilmentcertificatecanceles(data)
|
||||
uni.showToast({
|
||||
title: '撤销核销成功',
|
||||
icon: 'success'
|
||||
})
|
||||
setTimeout(() => {
|
||||
initial()
|
||||
}, 1000)
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.constant {
|
||||
padding-bottom: 32rpx;
|
||||
|
||||
.topbox {
|
||||
width: 100%;
|
||||
padding: 32rpx 28rpx;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.left {}
|
||||
|
||||
.right {
|
||||
width: 80%;
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottomconstant {
|
||||
padding: 0 28rpx;
|
||||
width: 100%;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.itemlist {
|
||||
margin-top: 32rpx;
|
||||
padding: 32rpx 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
.ordernumber {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-top: 16rpx;
|
||||
padding-bottom: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
}
|
||||
|
||||
.itemlists {
|
||||
padding-top: 24rpx;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.date {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.tag {
|
||||
background: #EAF4FD;
|
||||
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 20rpx;
|
||||
color: #318AFE;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.bottomtitle {
|
||||
width: 350rpx;
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.price {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.prices {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.pricees {
|
||||
margin-left: 12rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
text-decoration-line: line-through;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve"> <image id="image0" width="96" height="96" x="0" y="0"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
|
||||
AAB1MAAA6mAAADqYAAAXcJy6UTwAAABRUExURQAAAFCf/0uZ/0yZ/kyY/kuY/UyZ/0yZ/kuY/k2Z
|
||||
/0yZ/UqX/0uZ/0uY/kuZ/kyZ/kyY/UuZ/UiX/0uZ/kuZ/UyX/0yY/kqa/0uZ/kyZ/v///7LMcjEA
|
||||
AAAZdFJOUwAQX6+/n3/v31CAYHCwz8CQoCDwj0DQMODQpj2tAAAAAWJLR0QadWfkMgAAAAd0SU1F
|
||||
B+gMBQIoEmmNJfAAAAHtSURBVGje7ZnZloMgDEChm63RKlK3///RsXVciTUBOmdmDnkF7wVTSU4R
|
||||
IgQr5OF4ap3idD684V8iN3of19vW8o8+8M844wJv/A1D7I/ftoC8IC/vf4hIGoLEJx/bQupXkBqC
|
||||
u19BZgj88ts2CH5KkEoh8w8K1OtR1OBF0PNF8SmBevesB8HI/9AORr5Ai6CzYOKf0XFXwR7fVbDL
|
||||
pwp0ZsknChKBllICnyaIXyNgw6cJvgsrWPBpgmEM+HyaoEAMRD5NcBSGgcon/opgbSDzqd/BykDn
|
||||
k7/khYHBpx8VMwOHzziLkD6WwOccdmDDZ52mYMHnHdfA5zPrAbD53IIDXD67ogGTzy+Zl26OpPMt
|
||||
avL18bjS+X+muw6CIAiC3y5QJTmUjQAp9tsBfEHF4QtRsQUxT5CzBSlPkLIFUcHh1xFb0N5rBt+s
|
||||
dfuCrkieiIGVUorAKYIgCIIgCILgnwneXk9VjaNAq0LU2RZEJ11H1DgIdNz/75holJH1fUGZWQqa
|
||||
qbcrEIaehmub1jFb3grDehPp4rayyPWeYLlGVa7H5SLZjXEpLeNFMsybwNnzz8wicZsIucQmzPNt
|
||||
NoZjfzxk1ozhQqspNybM8p2Yg9U6sxjgucbNBczyXSFzZFytM4tO2usou3w3SooQIfzFFziLPvqM
|
||||
MV6wAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTA1VDAyOjQwOjE4KzAwOjAwFHedYwAAACV0
|
||||
RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wNVQwMjo0MDoxOCswMDowMGUqJd8AAAAodEVYdGRhdGU6
|
||||
dGltZXN0YW1wADIwMjQtMTItMDVUMDI6NDA6MTgrMDA6MDAyPwQAAAAAAElFTkSuQmCC" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Loading…
Reference in New Issue