Commit 3d12313d authored by home's avatar home

zxh

parent 6695b027
<script>
import {newsRemind} from "@/utils/api/api.js";//获取商家消息
export default {
export default {
data:{
},
onLaunch: function() {
// #ifdef APP-PLUS
// #ifdef APP-PLUS
//app关闭默认的启动 方法关闭启动图。但是这个时间不能太晚,6s 超时后依旧会主动关闭。
setTimeout(()=>{
plus.navigator.closeSplashscreen();
plus.navigator.closeSplashscreen();
},100)
// plus.push.addEventListener('click',message=>{
// // console.log('message',message)
// })
// plus.push.addEventListener('receive',message=>{
// console.log('message',message)
// if(true){
// }
// })
//获取设备id ios
plus.device.getInfo({
success:(e)=>{
//console.log('getDeviceInfo success: '+JSON.stringify(e));
console.log('getDeviceInfo success: '+JSON.stringify(e));
},
fail:(e)=>{
//console.log('getDeviceInfo failed: '+JSON.stringify(e));
console.log('getDeviceInfo failed: '+JSON.stringify(e));
}
});
});
const clientInfo = plus.push.getClientInfo();
console.log(clientInfo);
uni.getNetworkType({ //查看是否有网络
success: function (res) {
......@@ -37,14 +61,17 @@
});
// #endif
//安卓的
// #ifdef APP-PLUS
const clientInfo = plus.push.getClientInfo();
// #endif
setTimeout(()=>{
this.getnewsRemind();//不要一上来就提示
},15000)
},1000*15)
},
onShow: function() {
//console.log('App Show')
......@@ -58,26 +85,15 @@
var date = new Date();
let hours = date.getHours();//当前 时间 小时
let datestime = 5000;//默认15秒
let datestime = 1000*5;//默认15秒
// if(hours==11 || hours==12 || hours==13 ){//1级别 高峰时间
// datestime = 5000;//高峰时期 5s一次
// }else if(hours==10 || hours==14){//1级别
// datestime = 8000;//高峰时期 5s一次
// }
// else{
// datestime = 15000;
// }
if(this.$store.state.token!=""){//判断是否 已登录
let res = await newsRemind({})
let res = await newsRemind({
})
// console.log(res,'我登陆了')
if(res.code==0){
if(res.data.length!=0){
//进来了就是有消息
let msglist = res.data;
......@@ -86,7 +102,7 @@
// isvoice 开关
if(this.$store.state.isvoice){
this.$store.dispatch('AudioVoice',msglist[0].message).then((e) => {
console.log(e);
// console.log(e);
//震动 调用//400ms//长震动
uni.vibrateLong({
success:(re)=> {
......@@ -105,31 +121,106 @@
})
}
}else if(msglist.length!=0){
}else if(msglist.length!=0){
// 类型(0商城快捷支付,1商城快递,2商城店付,3餐饮快捷支付,4达达配送,5堂食,6鹿马配送)
let KJres = msglist.filter(item =>{
return item.type==3
})
let PSres = msglist.filter(item => {
return item.type==4 || item.type==5 || item.type==6
})
if(PSres.length !=0 ){
let msgtext = `你有新鹿马订单,请及时处理`;
if(this.$store.state.isvoice){
this.$store.dispatch('AudioVoice',msgtext).then((e) => {
console.info(e,"循环消息列表2");
//震动 调用//400ms//长震动
uni.vibrateLong({
success:(re)=> {
},
fail:(a)=> {
}
})
})
}else{
//震动 调用//400ms//长震动
uni.vibrateLong({
success:(re)=> {
},
fail:(a)=> {
}
})
}
}
// Thread.sleep(1000)
setTimeout(()=>{
if(KJres.length != 0){
let payText =""
for(let i=0 ;i<KJres.length;i++){
payText = payText+","+ KJres[i].contents
}
console.log(payText);
let msgtext = `${payText}`;
if(this.$store.state.isvoice){
this.$store.dispatch('AudioVoice',msgtext).then((e) => {
console.info(e,"循环消息列表2");
//震动 调用//400ms//长震动
uni.vibrateLong({
success:(re)=> {
},
fail:(a)=> {
}
})
})
}else{
//震动 调用//400ms//长震动
uni.vibrateLong({
success:(re)=> {
},
fail:(a)=> {
}
})
}
}
},1000*5)
// let msgtext = `你有${res.length}条新餐饮快捷支付到账,请及时处理`;
//多条的时候
let msgtext = `你有${msglist.length}条新的鹿马订单了,请及时处理`;
if(this.$store.state.isvoice){
this.$store.dispatch('AudioVoice',msgtext).then((e) => {
console.info(e,"循环消息列表2");
//震动 调用//400ms//长震动
uni.vibrateLong({
success:(re)=> {
},
fail:(a)=> {
}
})
})
}else{
//震动 调用//400ms//长震动
uni.vibrateLong({
success:(re)=> {
},
fail:(a)=> {
}
})
}
// let msgtext = `你有${msglist.length}条新的鹿马订单了,请及时处理`;
// if(this.$store.state.isvoice){
// this.$store.dispatch('AudioVoice',msgtext).then((e) => {
// console.info(e,"循环消息列表2");
// //震动 调用//400ms//长震动
// uni.vibrateLong({
// success:(re)=> {
// },
// fail:(a)=> {
// }
// })
// })
// }else{
// //震动 调用//400ms//长震动
// uni.vibrateLong({
// success:(re)=> {
// },
// fail:(a)=> {
// }
// })
// }
}
}
console.info("循环消息列表3");
//回调
......@@ -159,8 +250,10 @@
setTimeout(()=>{
this.getnewsRemind()
},datestime)
}
}
}
},
}
}
</script>
......
......@@ -64,8 +64,7 @@
let shop_id = event.currentTarget.dataset.shop_id;
switch (action) {
case 'immediatelyOrder': //立即接单 OK
that.immediatelyOrderfun(order_id, action);
that.businessReceiveOrder(order_id,shop_id);
that.immediatelyOrderfun(order_id, action);
console.info("立即接单");
break;
case 'refuseOrder': //拒接此单 OK
......@@ -109,19 +108,19 @@
},
// 商家接单派送
businessReceiveOrder(order_id,shop_id){
console.log(e);
uni.request({
url:`https://runer.jxdsy.cn/api/horsemans/horseAutoTakeOrder?order_id=${order_id}&shop_id=${shop_id}`,
success: (res) => {
console.log(res);
// businessReceiveOrder(order_id,shop_id){
// console.log(e);
// uni.request({
// url:`https://runer.jxdsy.cn/api/horsemans/horseAutoTakeOrder?order_id=${order_id}&shop_id=${shop_id}`,
// success: (res) => {
// console.log(res);
},
fail: (res) => {
console.log(res);
}
})
},
// },
// fail: (res) => {
// console.log(res);
// }
// })
// },
// 拒绝退款
async refuseEleRefund(order_id){
......@@ -153,9 +152,11 @@
async immediatelyOrderfun(){
let res = await immediatelyOrder({
order_id:this.dataorder.order_id,
});
console.log(res,'aaaaaaa')
if(res.code==0){
})
console.log(res)
if(res.code==0){
console.log(res,'aaaaaaa')
this.$api.msg(res.msg);
this.$emit("reload",{});//重新加载
}else{
......
......@@ -2,9 +2,9 @@
"name" : "鹿马商家助手",
//"appid" : "__UNI__FC9419E",
"appid" : "__UNI__1EA80F1", //这个是 web
"description" : "",
"versionName" : "1.0.81",
"versionCode" : 181,
"description" : "商家",
"versionName" : "1.0.84",
"versionCode" : 184,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......@@ -77,7 +77,8 @@
"ad" : {},
"push" : {
"unipush" : {}
}
},
"share" : {}
},
"icons" : {
"android" : {
......@@ -159,7 +160,10 @@
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
"usingComponents" : true,
"uniStatistics" : {
"enable" : false
}
},
"mp-alipay" : {
"usingComponents" : true
......@@ -173,6 +177,9 @@
"h5" : {
"devServer" : {
"https" : false
},
"uniStatistics" : {
"enable" : false
}
}
}
<template>
<!-- 添加外卖商品 -->
<view class="productpages">
<!-- input -->
<view class="productpages">
<!-- 还未完成扫码 -->
<view class="" @tap="saoma">
扫码
</view>
<view class="noecellbox">
<view class="title">产品名称</view>
<view class="inputbox flex">
......@@ -19,6 +23,45 @@
</view>
</view>
<!--
stock 商品库存
purchase 进货价钱
code 条形编码
commission 返佣比例
original_name 原始商品名
-->
<!-- 2020-10-12 -->
<view class="noecellbox">
<view class="title">商品库存</view>
<view class="inputbox flex">
<input class="input flex1" type="text" v-model="form.stock" value="" placeholder-class="plclass" placeholder="请填写产品价格" />
</view>
</view>
<view class="noecellbox">
<view class="title">条形编码</view>
<view class="inputbox flex">
<input class="input flex1" type="text" v-model="form.code" value="" placeholder-class="plclass" placeholder="请填写产品价格" />
</view>
</view>
<view class="noecellbox">
<view class="title">返佣比例</view>
<view class="inputbox flex">
<input class="input flex1" type="text" v-model="form.commission" value="" placeholder-class="plclass" placeholder="请填写产品价格" />
</view>
</view>
<view class="noecellbox">
<view class="title">进货价</view>
<view class="inputbox flex">
<input class="input flex1" type="text" v-model="form.cost_price" value="" placeholder-class="plclass" placeholder="请填写产品价格" />
</view>
</view>
<view class="briefIntroduction">
......@@ -62,10 +105,17 @@
<view class="addmigs">
<view class="titlehe">缩略图</view>
<robby-image-upload fileKeyName="img" :value="c_pics" :server-url="uploadurl1+'/merchant.php/FileUpload/uploadify'" :form-data="c_formData" :server-url-delete-image="uploadurl1"
@delete="c_delImage" @add="c_onImg1" @move="onMove_c" :limit="1"></robby-image-upload>
</view>
<view class="titlehe">缩略图</view>
<view class="" v-if="c_pics.length==0">
<robby-image-upload fileKeyName="img" :value="c_pics" :server-url="uploadurl1+'/merchant.php/FileUpload/uploadify'" :form-data="c_formData" :server-url-delete-image="uploadurl1"
@delete="c_delImage" @add="c_onImg1" @move="onMove_c" :limit="1"></robby-image-upload>
</view>
<view class="" v-if="c_pics.length!=0">
<image :src="c_pics[0].data" mode=""></image>
</view>
</view>
<!-- 多选列表 勾选的位置 -->
......@@ -92,7 +142,7 @@
</view>
</checkbox-group>
</view>
<view v-if="isshowsetkilltime">
<view v-if="isshowsetkilltime && activity_type==1">
<view class="noecellbox">
<view class="title">秒杀价格</view>
<view class="inputbox flex">
......@@ -116,7 +166,7 @@
</view>
</view>
</view>
<view class="checkboxs" v-if="isshowsetkilltime">
<view class="checkboxs" v-if="isshowsetkilltime && activity_type==1">
<view class="title">选择秒杀时段:</view>
<picker-view :value="ischeckedtime" indicator-style="height: 50px;" style="width: 100%; height: 200px;" @change="pickerChange">
<picker-view-column >
......@@ -149,7 +199,13 @@
},
name: 'product',
result:[],
form: {
form: {
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
stock:0, //商品库存
cost_price:'', //进货价钱
code:'' ,//条形编码
commission:'', //返佣比例
commodity_data:[], //原始商品名
picker_custom2: {},
piclist: [],//图
checkbox: [],//断选
......@@ -225,7 +281,51 @@
this.typeManagerfun();
this.getActivityListfun(); //获取数据列表
},
methods: {
methods: {
// https://www.mxnzp.com/api/barcode/goods/details?
//barcode=6938902618112
//&needImg=true
//&app_id=ct8txopjpneaiiev
//&app_secret=cUhnQ3AwM2Z3WjY4ZElOdVJkU3JEUT09
saoma(e){
console.log(this.$data.form.code)
uni.scanCode({
success:res => {
console.log(this.form);
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
this.$data.form.code = res.result
uni.request({
//app_id:qkkbptetyohxoiod app_secret:Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09
url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。
data: {
barcode: this.$data.form.code,
needImg: true,
app_id:'qkkbptetyohxoiod',
app_secret:'Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09'
},
method:'GET',
success: (results) => {
console.log(results.data);
this.$data.form.original_name = results.data.data.goodsName
this.$data.form.product_name = results.data.data.goodsName
this.$data.c_pics = [{code:0,data:results.data.data.img,msg:"success",time:"1587101904"}]
this.$data.form.commodity_data[0] = results.data.data
console.log(this.$data.form.commodity_data)
console.log(this.$data.form.original_name)
console.log(results.data.data.goodsName)
console.log(this.$data.form.product_name)
console.log(results.data.data.img)
console.log(this.$data.c_pics[0])
}
})
}
});
},
confirm(e){
console.log(e)
// this.parent_name=e.item.value;
......@@ -351,16 +451,19 @@
},
getForm() {
if(this.c_pics.length==0){
this.$api.msg("先上传图片");
if(this.c_pics.length==0){
this.$api.msg("上传产品图片");
return false;
}
if(this.form.activity_price==""||this.form.store_count==""||this.form.limit_num==""){
if(this.isshowsetkilltime && (this.form.activity_price==""||this.form.store_count==""||this.form.limit_num=="") ){
this.$api.msg("请填写完整秒杀数据");
return false;
}
// if(String(this.form.store_count).indexOf('.')!=-1 || String(this.form.limit_num).indexOf('.')!=-1){
// this.$api.msg("秒杀库存或限购数量不能为小数");
// return false;
......@@ -371,14 +474,20 @@
return false;
}
let can = {
let can = {
stock:this.form.stock, //商品库存
cost_price:this.form.cost_price, //进货价钱
code:this.form.code,//条形编码
commission:this.form.commission, //返佣比例
commodity_data:this.form.commodity_data, //产品数据
product_name:this.form.product_name,//产品名称
desc:this.form.desc,//产品描述
lunch_box_fee:this.form.lunch_box_fee,//餐盒费
action:this.form.action,//方式(添加:add,修改:edit)
price:this.form.price,//价格
cate_id:this.form.cate_id,
// photo:"",
// photo:this.form.c_pics[0].data,
//product_id
activity_price:this.form.activity_price,//秒杀价
store_count:this.form.store_count ,//秒杀库存
......@@ -411,6 +520,12 @@
if(this.c_pics.length!=0){
can.photo = this.c_pics[0].data;//上传的图片
}
console.log(this.$data.c_pics[0].data)
if(this.product_id!=""){
......
......@@ -65,7 +65,7 @@
</view>
<view class="cell_input jus-b ali-c">
<view class="lablename">起步配送费:</view>
<view class="lablename">满多少起送:</view>
<view class="inputboxs ">
<input type="number" class="input" value="" v-model="nitial_delivery_fee" placeholder-class='hahatext' placeholder="请输入" />
</view>
......
......@@ -53,11 +53,18 @@
</view>
</view>
<view class="topbox_20 mt-20 ">
<view class="topbox_20 mt-20 ">
<view class="ali-z sz_30 bt_hei flex ali-c jus-b">
<view>总计</view>
<view>¥{{detail.amount}}</view>
<view>已优惠:</view>
<view style="color: red;font-size: 20upx;">{{detail.cprice}}</view>
</view>
</view>
<view class="topbox_20 mt-20 ">
<view class="ali-z sz_30 bt_hei flex ali-c jus-b">
<view>总计:</view>
<view style="color: red;">¥{{detail.total}}</view>
</view>
</view>
......
......@@ -166,7 +166,8 @@ const store = new Vuex.Store({
Voice(text);//播放
resolve();//结束
})
},
},
AudioVoice(context,text){//获取音频对象播放
return new Promise(resolve=>{
Voice({
......
......@@ -15,10 +15,16 @@ function getBDVoicToken() {
//这里用的是自己的账户 150的 后面加入我不在了 自己去注册一个 https://ai.baidu.com/
// let APIKey = "LYDenqXnlBbFdvuxumqspqMz";
// let SecretKey = "4DX96MfnSiAOCbGLxtIFsoKXX9LMlLID";
let APIKey = "HIOLreKUVv3NVCwVN1OZBM82";
let SecretKey = "g1RbFa0Mbmgyf9sq7i1G1siEAw7ArxdT";
// let SecretKey = "4DX96MfnSiAOCbGLxtIFsoKXX9LMlLID";
// 陶
// let APIKey = "HIOLreKUVv3NVCwVN1OZBM82";
// let SecretKey = "g1RbFa0Mbmgyf9sq7i1G1siEAw7ArxdT";
//王总监
let APIKey = "SDfqqKlhE5FyEdrZx3IfYvKx";
let SecretKey = "lvYCYc1U5G6dgwFstYNeqHEI679PrUQp";
uni.request({ // 强烈建议此接口由后端访问并且维护token有效期,否则前端每次访问都会刷新token
//此url为专门插件测试预览用的key和secret key, 请替换为自己申请的key
......
......@@ -3,14 +3,14 @@
module.exports = {
//是否为开发调试环境 true为本地环境 false 为正式环境
isdebug:false,//正式
// isdebug:true,//测试
// isdebug:false,//正式
isdebug:true,//测试
xqdebug:false,//正式权限
// xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
// xqdebug:false,//正式权限
xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
// #ifdef APP-PLUS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment