Commit e252e079 authored by haitao's avatar haitao

fd

parents 87d6fd7c 3d12313d
<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>
......
......@@ -13,7 +13,7 @@
</view>
</view>
<!-- 上面的是 -->
<!-- reorder -->
<view class="mingxi oneline" v-for="(item,index) in dataorder.products" :key="index">{{item.productname}} x {{item.num}}</view>
<view class="beizhu flex jus-b ali-c">
<text class="beizhutext oneline flex1" v-if="dataorder.remark">备注:{{dataorder.remark||''}}</text>
......@@ -28,9 +28,9 @@
<view class="btnbox flex flex1 jus-e">
<!-- <view class="btns" @tap.stop="toxq" >查看详情</view>
<view class="btns" v-if="dataorder.status==1" @tap.stop="immediatelyOrderfun" >立即接单</view>
<view class="btns" v-if="dataorder.status==1" @tap.stop="refuseOrderfun" >拒绝接单</view> -->
<view class="btns" v-if="dataorder.status==1" @tap.stop="refuseOrderfun" >拒绝接单</view> @tap.stop="operation" -->
<block v-for="(action,index) in dataorder.order_operation" :key="index">
<view :class="action.class_name" :data-orderid='dataorder.order_id' @tap.stop="operation" :data-action='action.way' :data-is_ld='dataorder.buytype'>{{action.name}}</view>
<view :class="action.class_name" :data-orderid='dataorder.order_id' @tap.stop="operation" :data-action='action.way' :data-is_ld='dataorder.buytype'>{{action.name}}</view>
</block>
</view>
</view>
......@@ -54,16 +54,17 @@
},
methods:{
/**
* 订单操作
* 订单操作
*
*/
operation (event) {
let that = this;
let action = event.currentTarget.dataset.action;
let order_id = event.currentTarget.dataset.orderid;
let order_id = event.currentTarget.dataset.orderid;
let shop_id = event.currentTarget.dataset.shop_id;
switch (action) {
case 'immediatelyOrder': //立即接单 OK
that.immediatelyOrderfun(order_id, action);
// oneKeyCancel
console.info("立即接单");
break;
case 'refuseOrder': //拒接此单 OK
......@@ -101,8 +102,26 @@
this.$emit("reload",{});//重新加载
}else{
this.$api.msg(res.msg);
}
},
}
},
// 商家接单派送
// 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);
// }
// })
// },
// 拒绝退款
async refuseEleRefund(order_id){
let res = await refuseEleRefund({
......@@ -127,16 +146,19 @@
this.dataorder.index = this.index;
this.$emit('deleteOrderFun',this.dataorder);
},
},
//立即接单 方法 外卖的
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",{});//重新加载
this.$emit("reload",{});//重新加载
}else{
this.$api.msg(res.msg);
}
......
......@@ -84,12 +84,11 @@
if(!_self.value){
_self.value = []
}
uni.chooseImage({
count: _self.limit ? (_self.limit - _self.value.length) : 999,
success: function(e){
var imagePathArr = e.tempFilePaths
var imagePathArr = e.tempFilePaths
//如果设置了limit限制,在web上count参数无效,这里做判断控制选择的数量是否合要求
//在非微信小程序里,虽然可以选多张,但选择的结果会被截掉
//在app里,会自动做选择数量的限制
......@@ -106,12 +105,8 @@
}
}
console.log('s1:',imagePathArr)
let arrs=[]
for(let i=0; i<imagePathArr.length;i++){
arrs.push(imagePathArr[i])
}
//检查服务器地址是否设置,设置即表示图片要上传到服务器
if(_self.serverUrl){
......@@ -134,12 +129,12 @@
},
name: keyname,
success: function(res){
console.log(JSON.parse(res.data),'成功了啊啊')
if(res.statusCode === 200){
//_self.value[remoteUrlIndex] = JSON.parse(res.data)
_self.value.push(JSON.parse(res.data))
console.log('s3:',_self.value)
completeImages ++
if(_self.showUploadProgress){
......@@ -165,7 +160,6 @@
}))
}
Promise.all(promiseWorkList).then((result)=>{
console.log('s4:',_self.value)
_self.$emit('add', {
currentImages: imagePathArr,
allImages: _self.value //id+url
......
......@@ -2,9 +2,9 @@
"name" : "鹿马商家助手",
//"appid" : "__UNI__FC9419E",
"appid" : "__UNI__1EA80F1", //这个是 web
"description" : "",
"versionName" : "1.0.82",
"versionCode" : 182,
"description" : "商家",
"versionName" : "1.0.84",
"versionCode" : 184,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......@@ -77,7 +77,8 @@
"ad" : {},
"push" : {
"unipush" : {}
}
},
"share" : {}
},
"icons" : {
"android" : {
......@@ -145,8 +146,9 @@
"portrait7" : "C:/Users/Administrator/Desktop/证书/d0abce82961b508e6a0b9924d15fe86.png",
"landscape7" : "C:/Users/Administrator/Desktop/证书/d0abce82961b508e6a0b9924d15fe86.png",
"portrait-1194h@2x" : "C:/Users/Administrator/Desktop/证书/d0abce82961b508e6a0b9924d15fe86.png"
}
}
}
}
}
},
"compilerVersion" : 2
......@@ -159,7 +161,10 @@
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
"usingComponents" : true,
"uniStatistics" : {
"enable" : false
}
},
"mp-alipay" : {
"usingComponents" : true
......@@ -173,6 +178,9 @@
"h5" : {
"devServer" : {
"https" : false
},
"uniStatistics" : {
"enable" : false
}
}
}
......@@ -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>
......
......@@ -23,7 +23,8 @@
<view class="xiaol">销量:{{item.sold_num}}</view>
</view>
<view class="btn">
<view class="btn_01" @tap="jump_edit(item)" >编辑</view>
<view class="btn_01" @tap="jump_edit(item)">编辑</view>
<view class="btn_01" @tap="pullfun(item,index)" v-if="current==0" >下架</view>
<view class="btn_01" @tap="pushfun(item,index)" v-if="current==1" >上架</view>
<view class="btn_01" @tap="delfun(item,index)" >删除</view>
......@@ -35,7 +36,7 @@
</block>
<view class="tjsp">
<navigator url="/pages/edit/product/addshop">
<navigator :url="'/pages/edit/product/addshop?activity_type='+this.activity_type" >
<view class="flex flex-direction">
<button class="cu-btn bg-red margin-tb-sm lg">添加商品</button>
</view>
......@@ -72,14 +73,16 @@
isshowall:true,
isselect:"2",
sendindex:"",
money_type:""
money_type:"",
activity_type:0
}
},
onLoad(opdata) {
console.info(opdata)
this.money_type=opdata.money_type;
this.money_type=opdata.money_type;
this.activity_type = opdata.activity_type//秒杀资格判断
if(opdata.isselect==1){
this.isselect = 1;
this.sendindex = opdata.sendindex;//插入索引
......@@ -98,8 +101,10 @@
onShow() {
this.page =0;
this.goodsListdata = [];
this.isshowall = true;
this.getgoodsListfun();
this.isshowall = true;
this.getgoodsListfun();
},
computed:{
staticUrl(){
......@@ -121,6 +126,8 @@
page:this.page,
});
if(res.code==0){
console.log(res);
if(res.data.length!=0){
this.goodsListdata = [...this.goodsListdata,...res.data];
......@@ -268,14 +275,17 @@
// }
// }
// })
},
},
//编辑产品
jump_edit(item) {
uni.navigateTo({
//url: '/pages/edit/product/product?id=' + id
url:"/pages/edit/product/addshop?id="+item.goods_id+'&money_type='+this.money_type,
url:"/pages/edit/product/addshop?id="+item.goods_id+'&money_type='+this.money_type+'&activity_type='+this.activity_type,
})
},
},
//tab切换事件
onClickItem(index) {
if (this.current !== index) {
......
......@@ -140,19 +140,46 @@
<view class="title">标识:</view>
<!-- 表特和类目 -->
<checkbox-group @change="checkboxChange">
<view class="chindlost ali-c flex flex-wrap">
<label class="lableitem flex ali-c" v-for="(item,index) in listchind" :key="index">
<view>
<checkbox color="#FF6900" :value="item.value" :checked="item.checked" />
</view>
<view class="titles">{{item.name}}</view>
</label>
</view>
<view class="chindlost ali-c flex flex-wrap" >
<label class="lableitem flex ali-c" v-for="(item,index) in listchind" :key="index">
<view>
<checkbox color="#FF6900" :value="item.value" :checked="item.checked" />
</view>
<view class="titles">{{item.name}}</view>
</label>
<view v-if="activity_type==1">
<label class="lableitem flex ali-c" v-for="item of listissetkill" :key="index">
<view>
<checkbox color="#FF6900" :value="item.value" :checked="item.checked" />
</view>
<view class="titles">{{item.name}}</view>
</label>
</view>
<!-- <view v-for="(item,index) in seckilltimelist">
<label class="lableitem flex ali-c">
<view>
<checkbox color="#FF6900" value="is_seckill" :checked="false" />
</view>
<view class="titles">{{item.title}}</view>
</label>
</view> -->
</view>
</checkbox-group>
</view>
<!-- 单选列表 -->
<view class="checkboxs" v-if="isshowsetkilltime">
<view class="title">选择秒杀时段:</view>
<picker-view :value="ischeckedtime" indicator-style="height: 50px;" style="width: 100%; height: 200px;" @change="pickerChange">
<picker-view-column>
<view v-for="(item,index) in seckilltimelist" :key="index" style="line-height: 50px; text-align: center;">{{item.title}}</view>
</picker-view-column>
</picker-view>
</view>
<!-- 多选end -->
<view class="submits active" @tap="geteditOk">发布商品</view>
<!-- create_goods -->
......@@ -167,7 +194,9 @@
import {getGoodsCate,addEditGoods,goodsDetails} from "@/utils/api/api.js";
import jinedit from "@/components/jinedit/jinedit.vue";
import jinedit from "@/components/jinedit/jinedit.vue";
import {getActivityList} from '@/utils/api/merchant.js';
export default {
components:{
......@@ -183,7 +212,8 @@
}
},
data() {
return {
return {
ischeckedtime:[0],
money_type:"",//佣金
myProps: {
label: 'value',
......@@ -202,11 +232,19 @@
formData: {
"imgtype": "comment"
},
indexsss:0,
indexsss:0,
listchind:[
{name:"是否新产品",value:"is_new",checked:false},
{name:"是否热卖产品",value:"is_hot",checked:false},
],
{name:"是否热卖产品",value:"is_hot",checked:false},
// {name:"是否秒杀产品",value:"is_seckill",checked:false,status:1}, /* */
],
seckilltimelist:[], //秒杀时间列表
isshowsetkilltime:false,//是否显示秒杀时间
listissetkill:[{name:"是否秒杀产品",value:"is_seckill",checked:false}],
activity_type:0,//判断是否可以秒杀
index:0,
idx:0,
idj:0,
......@@ -232,10 +270,13 @@
photos:"",//更多详情图
details:'',///商品详情(编辑器插件)
is_new:"0",//0 1 是否新产品
is_hot:"0",//0 1 是否热卖产品
action:"add",//方式(添加:add,修改:edit)
money:''
is_hot:"0",//0 1 是否热卖产品
is_seckill:"0",//0 1 是否秒杀产品
activity_id:'0',//秒杀activity_id
activity_list:'49,',//秒杀列表
action:"add",//方式(添加:add,修改:edit)
money:''
},
goodsCate:[],
shopCate:[],
......@@ -246,10 +287,13 @@
c_photosTwo:[],//更多图里面的数据
c_pics: [],//主图的数据
c_picsTwo:[],//更多详情图
issubmit:true,//重复提交开关
issubmit:true,//重复提交开关
selchildList:[],//勾选列表选中的值
isjiumodelshop:{},//修改信息的时候 默认的信息
isjiumodelshop:{},//修改信息的时候 默认的信息
};
},
computed: {
......@@ -266,21 +310,22 @@
}
},
onLoad(opdata) {
console.info(opdata)
this.money_type=opdata.money_type
this.money_type=opdata.money_type
this.activity_type = opdata.activity_type
if(opdata.id!="" && opdata.id!=undefined){
this.canform.goods_id = opdata.id;//修改的商品id
this.canform.action = "edit";
uni.setNavigationBarTitle({
title:"编辑产品"
})
}
//获取下拉分类选择
this.goods_type();
this.goods_type();
// 获取秒杀时间段
this.getActivityListfun()
},
methods:{
confirm(e){
......@@ -298,14 +343,28 @@
},
pickertow(){
this.$refs.picker1.show() // 显示
},
// 秒杀列表
async getActivityListfun(){
let res = await getActivityList({
audit:1,
})
if(res.code==0){
console.log(res,3333)
this.seckilltimelist = res.data.head
}
},
//获取原来的商品详情信息
async goodsDetailsfun(){
let res = await goodsDetails({
goods_id:this.canform.goods_id,
});
if(res.code==0){
this.isjiumodelshop = res.data;//赋值
if(res.code==0){
console.log(res)
this.isjiumodelshop = res.data;//赋值
this.canform.title = res.data.title;
this.canform.intro = res.data.intro;
......@@ -317,7 +376,7 @@
this.canform.num = res.data.num;//库存 num
this.canform.cate_id = res.data.cate_id;//产品分类
this.canform.money = res.data.money;//佣金
this.canform.activity_id = res.data.activity_id;
//处理分类初始值
for(let i=0;i<this.goodsCate.length;i++){
let itemone = this.goodsCate[i].children;
......@@ -346,7 +405,6 @@
data:"",
msg:"success",
time:"1587021687",
};
obj.data = item.photo;
this.c_photosTwo.push(item.photo);//默认值
......@@ -363,17 +421,46 @@
let listchind= [
{name:"是否新产品",value:"is_new",checked:res.data.is_new==1?true:false},
{name:"是否热卖产品",value:"is_hot",checked:res.data.is_hot==1?true:false},
];
this.listchind = listchind;
];
// console.log(res.activity_list=="49,",res.data.activity_list);
let listissetkill =[{name:"是否秒杀产品",value:"is_seckill",checked:res.data.activity_list=="49,"?true:false}]
this.listissetkill = listissetkill;
if(res.data.is_new==1){
this.selchildList.push("is_new");
}
if(res.data.is_hot==1){
this.selchildList.push("is_hot");
}
this.listchind = listchind;
if(res.data.activity_list == '49,'){
this.listissetkill[0].checked = true
this.isshowsetkilltime = true
console.log(this.seckilltimelist);
console.log(this.canform.activity_id)
let indexlist = this.seckilltimelist.filter((item,index)=>{
if(item.activity_id==this.canform.activity_id){
return item
}
})
console.log(indexlist)
let temparr = indexlist[0]
let index = this.seckilltimelist.indexOf(temparr)
console.log(index)
this.ischeckedtime[0] = index
}
// if(res.data.is_new==1){
// this.selchildList.push("is_new");
// }
// if(res.data.is_hot==1){
// this.selchildList.push("is_hot");
// }
}else{
this.$api.msg(res.msg);
......@@ -447,6 +534,8 @@
}
let selchildList = this.selchildList;
console.log(selchildList)
selchildList.forEach((item,index)=>{//勾选的两个
if(item=="is_new"){
......@@ -454,8 +543,10 @@
}
if(item=="is_hot"){
this.canform.is_hot= "1";
}
}
// if(item=="is_seckill"){
// this.canform.is_seckill= "1";
// }
})
// console.info(this.canform,"canform");
......@@ -463,12 +554,14 @@
//添加
console.log(this.canform.mall_price)
console.log(this.canform.price)
console.log(this.canform.price)
if(parseFloat(this.canform.price)<parseFloat(this.canform.mall_price)){
this.$api.msg('商城价格不能大于市场价格');
this.issubmit=true;
return;
}
}
let res = await addEditGoods(this.canform)
......@@ -488,17 +581,36 @@
})
},1000)
}else{
this.$api.msg(res.msg);
this.$api.msg(res.msg);
}
this.issubmit=true;
}
},
},
//多选 勾选 列表
checkboxChange(e){
// console.log(e);
checkboxChange(e){
this.isshowsetkilltime = e.detail.value.indexOf('is_seckill') ==-1? false:true;
// if(e.detail.value.indexOf('is_seckill')!=-1){
// this.getActivityListfun();
// }
if(this.isshowsetkilltime){
this.canform.activity_list ="49,"
}else{
this.canform.activity_list =""
}
console.log(this.canform.activity_list)
this.selchildList = e.detail.value;
},
//单选框
pickerChange(e){
// console.log(e)
// console.log(this.seckilltimelist[e.detail.value[0]].activity_id)
this.canform.activity_id = this.seckilltimelist[e.detail.value[0]].activity_id;
},
// 改变下拉选项 一级的
// bindPickerChange (event) {
......
......@@ -32,11 +32,11 @@
<view class="btnbox flex">
<view class="btns btnboxdel" @tap="deleteEleProductfun(item,index)">删 除</view>
<view class="btns btnboxxj" @tap="Selectiondata(item)" v-if="tabactive==1 && isselect==1">加入活动</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,1,index)" v-else-if="tabactive==1">下 架</view>
<view class="btns btnboxxj" @tap="sold_outfun(item.id,0,index)" v-show="tabactive==2">上 架</view>
<view class="btns btnboxxj" @click="setSpecs(item.product_id)" >规格</view>
<view class="btns btnboxxj" @click="setSpecs(item.product_id)" >规格</view>
<view class="btns btnboxdel" @tap="tochanges(item,index)">修 改</view>
</view>
</view>
......@@ -64,7 +64,7 @@
<view class="btns btns2" v-show="tabactive==2" @tap="sold_outfun('all',0)">上架</view>
</view> -->
<navigator url="/pages/addEditEleProduct/addEditEleProduct" class="submitbtns">添加</navigator>
<navigator :url="'/pages/addEditEleProduct/addEditEleProduct?activity_type='+activity_type" class="submitbtns">添加</navigator>
</view>
<pageScrollTo v-if="isshowtop" ></pageScrollTo>
......@@ -96,11 +96,12 @@
idArr:["16535","7350","6164"],//全选 选中的id
isselect:2,//1 是抽奖选择商品状态 2是默认的
sendindex:0,//修改数据插入索引
activity_type:0
};
},
onLoad(opdata){
this.activity_type = opdata.activity_type
if(opdata.isselect==1){
this.isselect = 1;
......@@ -109,7 +110,8 @@
this.isselect = 2;
}
},
},
onShow() {
this.goods_list = [];
this.page = 0;
......@@ -141,7 +143,7 @@
//修改外卖产品
tochanges(data,index){
uni.navigateTo({
url:`/pages/addEditEleProduct/addEditEleProduct?id=${data.product_id}`,
url:`/pages/addEditEleProduct/addEditEleProduct?id=${data.product_id}&activity_type=${this.activity_type}`,
})
},
//删除外卖产品
......
......@@ -72,7 +72,7 @@
</view>
<view class="jiu_max " v-if="shop_type == 'ele'">
<navigator url="/pages/eleProduct/eleProduct">
<navigator :url="'/pages/eleProduct/eleProduct?activity_type='+ activity_type ">
<view class="jiu_min">
<view><image class="img" src="/static/icon/20.png" mode=""></image></view>
<view>外卖产品</view>
......@@ -204,6 +204,15 @@
<view><image class="img" src="/static/turntable/turntable.png" mode=""></image></view>
<view>大转盘</view>
</view>
</view>
<view class="jiu_max " >
<navigator url="/pages/deliveryCost/deliveryCost">
<view class="jiu_min">
<view><image class="img" src="/static/icon/psfei.png" mode=""></image></view>
<view>外卖配送费设置</view>
</view>
</navigator>
</view>
</view>
<view class="BH"></view>
......@@ -235,7 +244,8 @@
countdata: {},
shop_type: "", //店铺类型 ele goods
is_luck_draw:"",
money_type:""
money_type:"",
activity_type:0
}
},
components: {
......@@ -284,7 +294,7 @@
methods: {
jump(){
uni.navigateTo({
url:'/pages/edit/pro_manage/pro_manage?money_type='+this.money_type
url:'/pages/edit/pro_manage/pro_manage?money_type='+this.money_type + '&'+'activity_type='+this.activity_type
})
},
......@@ -365,9 +375,11 @@
async storeIndexfun() {
let res = await storeIndex({
});
});
// console.log(res);
// console.log(res.data.shop_info.activity_type)
uni.stopPullDownRefresh(); //结束下拉刷新
console.log(res.data.shop_info.shop_id)
// console.log(res.data.shop_info.shop_id)
if (res.code == 0) {
this.countdata = res.data.counts; //统计的数据
this.shop_type = res.data.shop_type; //店铺类型 商城 goods
......@@ -375,7 +387,8 @@
this.shop_id = res.data.shop_info.shop_id;
this.is_luck_draw=res.data.shop_info.is_luck_draw
this.money_type=res.data.shop_info.money_type
this.money_type=res.data.shop_info.money_type
this.activity_type = res.data.shop_info.activity_type //判断是否有秒杀资格
} else {
this.$api.msg(res.msg);
......
......@@ -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>
......
......@@ -22,7 +22,9 @@
<text class="title">规格模型:</text>
<view class="modlename">{{goodsSpec_goodsType[Typeindex].name?goodsSpec_goodsType[Typeindex].name:""}}</view>
<image class="dopicon" src="/static/news/dopicon.png" mode=""></image>
</view>
</view>
<lb-picker ref="picker" :list="goodsSpec_goodsType" :value='Typeindex' range-key="label" :props="myProps" @confirm='confirm'></lb-picker>
......@@ -37,7 +39,8 @@
<view class="specsShop_list">
<view class="specsShop_list_item" v-for="(item,index) in endobjdata" :key="index">
<view class="specsShop_list_item" v-for="(item,index) in endobjdata" :key="index">
<view class="itemnames">{{item.key_name}}</view>
<view class="cleelable flex ali-c">
......@@ -45,13 +48,30 @@
<view class="inputbox flex1">
<input class="input" type="text" value="" v-model="item.price" placeholder="请输入售价" ></input>
</view>
</view>
</view>
<view class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 秒杀价</view>
<view class="inputbox flex1">
<input class="input" type="text" value="" v-model="item.seckill_price" placeholder="请输入秒杀价" ></input>
</view>
</view>
<view class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 限购数量</view>
<view class="inputbox flex1">
<input class="input" type="number" value="" v-model="item.limit_num" placeholder="请输入限购数量" @input="isInt"></input>
</view>
</view>
<view class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 库存</view>
<view class="names"><text class="bitian">*</text> 秒杀库存</view>
<view class="inputbox flex1">
<input class="input" type="text" v-model="item.store_count" value="" placeholder="请输入库存" ></input>
<input class="input" type="number" v-model="item.store_count" value="" placeholder="请输入库存" @input="isInt" ></input>
</view>
</view>
</view>
<!-- <QSInput :name="name" titleColor="#000000" variableName="shoptitle" required layout="row" title="库存" v-model="form.shoptitle"></QSInput> -->
<!-- <QSInput :name="name" titleColor="#000000" variableName="shoptitle" required layout="row" title="售价" v-model="form.shoptitle"></QSInput> -->
<!-- <QSPics :name="name" variableName="pics" title="商品图片" v-model="form.pics"></QSPics> -->
......@@ -82,11 +102,11 @@
<script>
import {goodsSpec,ajaxGetSpecSelect,addEditProductSpec} from "@/utils/api/api.js";
import yiCheckbox from "@/components/yiCheckbox/yiCheckbox.vue";
import config from "@/utils/config.js";
import config from "@/utils/config.js";
import {getActivityList} from '@/utils/api/merchant.js';
/**
* 查询商品的规格 商品规格详情 goodsSpec
*
*
* 查询商品的规格 商品规格详情 goodsSpec
* */
export default {
components:{
......@@ -99,8 +119,12 @@
value: 'cate_id',
},
store_count:'',
limit_num:'',
seckill_price:'',
name:"shops",
name:"shops",
form:{
pics: [{name: '测试'}],
shoptitle:"",
......@@ -144,24 +168,41 @@
return this.$store.state.staticUrl;
}
},
onLoad(opdata) {
onLoad(opdata) {
console.log(opdata)
this.goods_id = opdata.id;
this.goodsSpecfun();//商品规格详情
},
methods:{
methods:{
isInteger(obj){
return obj%1 === 0;
},
isInt(e){
console.log(e)
if(!this.isInteger(e.detail.value)){
// console.log(parseInt(this.form.store_count)%1 != 0)
// console.log(parseInt(this.form.limit_num) % 1 != 0)
this.$api.msg("秒杀库存或限购数量不能为小数");
}
},
confirm(e){
console.log(e)
// this.parent_name=e.item.value;
// this.canform.cate_id=;
// this.cate_name = e.item.cate_name;
this.type_id =e.item.id;
this.Typeindex = e.index;
this.ajaxGetSpecSelectfun();//获取选中的分类下面的规格
},
},
//分类选择触发后
bindPickerChange(e){
this.$refs.picker.show() // 显示
bindPickerChange(e){
this.$refs.picker.show() // 显示
},
......@@ -206,45 +247,74 @@
// 库存,图片,售价 添加规定的方法 最终提交的方法
addEditProductSpecfun(){
// addEditProductSpec
let isbool = false;
let isbool = false;
// store_count:'',
// limit_num:'',
// seckill_price:'',
console.log(this.endobjdata)
isbool = this.endobjdata.every((item,index)=>{
return item.price!="" && item.price!="";
})
return item.price!="" && item.store_count!="" && item.limit_num!="" && item.seckill_price !="";
})
if(!isbool){
this.$api.msg("规格填写有误");
return false;
}
if(this.endobjdata.length==0){
this.$api.msg("你必须填写规格才能提交");
return false;
}
if(this.endobjdata[0].activity_price==""||this.endobjdata[0].store_count==""||this.endobjdata[0].limit_num==""){
this.$api.msg("请填写完整秒杀数据");
return false;
}
if(!this.isInteger(this.endobjdata[0].limit_num) || !this.isInteger(this.endobjdata[0].store_count)){
this.$api.msg("秒杀库存或限购数量不能为小数");
return false;
}
console.info("endobjdata",this.endobjdata,this.endobjdata);
// return false;
console.log(this.goods_id)
console.info("endobjdata",this.endobjdata);
// return false;
addEditProductSpec({
goods_id:this.goods_id,//商品id
type_id:this.type_id,//模型id
item:this.endobjdata,
item:this.endobjdata,
}).then((res)=>{
if(res.code==0){
if(res.code==0){
console.log(res,"ress")
this.$api.msg(res.data);
setTimeout(()=>{
uni.navigateBack({
})
},1000)
},1000)
}else{
this.$api.msg(res.data);
}
})
},
//商品规格详情 第一步 获取 一级
async goodsSpecfun(){
async goodsSpecfun(){
let res = await goodsSpec({
goods_id:this.goods_id
});
});
console.log(res,"goodsSpec")
if(res.code==0){
this. goodsSpec_goodsType = res.data.goodsType;
this. goodsSpec_info = res.data.info;
......@@ -268,7 +338,10 @@
let res = await ajaxGetSpecSelect({
goods_id:this.goods_id,//商品id
type_id:this.type_id,
});
});
console.log(res,"ajaxGetSpecSelectfun")
if(res.code==0){
//items_ids 商品规格key,将规格id遍历
// specList 规格详情列表
......@@ -393,7 +466,8 @@
changeupdata(e){
// console.info("数据改变后",e);
},
},
//初始化数据呀
initdatalist(){
var arr1 = [1,2,3];
......@@ -410,18 +484,25 @@
},
inititemdata(){
}
},
}
},
watch:{
form(e,c){
console.info(e,c,"watch");
}
}
},
}
</script>
<style lang="scss">
@import "./specsShop.scss";
</style>
</style>
\ No newline at end of file
......@@ -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
......
......@@ -28,4 +28,10 @@ import request from "./../request.js";//这里用的是two
// 订单号
export function showsend(data) {
return request.post("Turntable/send", data, { noAuth: true});
}
\ No newline at end of file
}
// 秒杀状态列表
export function getActivityList(data){
return request.post("store/getActivityList", data, { noAuth: true});
}
\ No newline at end of file
......@@ -4,8 +4,8 @@ module.exports = {
//是否为开发调试环境 true为本地环境 false 为正式环境
isdebug:false,//正式
//isdebug:true,//测试
// isdebug:false,//正式
isdebug:true,//测试
......
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