Commit 6f59df4d authored by haitao's avatar haitao

fd

parents 48554317 282c77f4
......@@ -122,7 +122,8 @@
console.log('这里')
let res = await newsRemind({
uid:this.$store.state.userInfo.user_id,
cid:cid
cid:cid,
});
if(res.code==0){
......
This diff is collapsed.
/**
* 获取某年某月有多少天
*/
export const getOneMonthDays = (year,month)=>{
month = Number(month);
const baseMonthsDays = [31,28,31,30,31,30,31,31,30,31,30,31];
if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
if(month === 1){
baseMonthsDays[month] = 29;
}
}
return baseMonthsDays[month];
}
/**
* 获取日期的年月日时分秒
*/
export const getTimeArray = (date)=>{
const year = date.getFullYear();
const month = date.getMonth()+1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
return [year,month,day,hour,minute,second];
}
/**
* 小于10的数字前面补0
*/
export const addZero = (num)=>{
return num < 10 ? '0' + num : num;
}
/**
* 获取当前值在数组中的索引
*/
export const getIndexOfArray = (value,array)=>{
let index = array.findIndex(item => item == value);
return index > -1 ? index : 0;
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
"transformPx" : false,
"compatible" : {
"ignoreVersion" : true, //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
"runtimeVersion" : "2.9.7,2.9.8", //兼容的uni-app运行环境版本号,多个版本使用,分割
"runtimeVersion" : "2.9.3,2.9.7,2.9.8", //兼容的uni-app运行环境版本号,多个版本使用,分割
"compilerVersion" : "2.9.8" //兼容的编译器版本号
},
/* 5+App特有相关weex */
......
......@@ -395,8 +395,31 @@
"navigationBarTitleText": "物流发货",
"navigationBarBackgroundColor":"#FFFFFF"
}
}
],
},{
"path":"pages/publishActivities/activityList/activityList",
"style" : {
//机型列表
"navigationBarTitleText": "活动列表",
"navigationBarBackgroundColor":"#FFFFFF",
"enablePullDownRefresh":true
}
},{
"path":"pages/publishActivities/publishActivity/publishActivity",
"style" : {
//机型列表 activityDetail
"navigationBarTitleText": "发布免费活动",
"navigationBarBackgroundColor":"#FFFFFF"
}
},{
"path":"pages/publishActivities/activityDetail/activityDetail",
"style" : {
//机型列表 activityDetail
"navigationBarTitleText": "活动详情",
"navigationBarBackgroundColor":"#FFFFFF",
"enablePullDownRefresh":true
}
} ],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "",
......
......@@ -158,7 +158,6 @@
<view class="inputbox flex">
<picker mode="date" fields="day" :value="form.manufacture_date" @change="bindDateChange">
<input disabled="true" class="input flex1" type="text" v-model="form.manufacture_date" value="" placeholder-class="plclass" placeholder="请填写生产日期" />
<!-- <view class="uni-input">{{date}}</view> -->
</picker>
</view>
</view>
......@@ -398,37 +397,37 @@
name: 'product',
result:[],
form: {
// mandatory:'2',
// linkage_id:'',
// //cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
// specifications:'',//商品规格
// stock:'', //商品库存
// cost_price:'', //进货价钱
// code:'' ,//条形编码
// commission:'', //返佣比例
// sell_type:0,// 售卖类型
// commodity_data:{}, //原始商品名
// quality_guarantee_period:0, //保质期(月)
// manufacture_date:'' , //生产日期
// manufacturer :'', ///生产厂商
// brand :'', // 品牌
// checkbox: [],//断选
// product_id:"",//修改的时候的产品id
// product_name:"",//产品名称
// desc:"",//产品描述
// cate_id:"",//产品分类id
// photo:"",//产品图片
// lunch_box_fee:'',//餐盒费
// is_new:"",//是否新产品
// is_hot:"",//是否热卖产品
// action:"add",// 方式(添加:add,修改:edit)
// price:"",//价格
// activity_price:"",//秒杀价
// store_count:"" ,// 秒杀库存
// is_seckill:"0",//0 1 是否秒杀产品
// activity_id:'0',//秒杀activity_id
// activity_list:'',//秒杀列表
// limit_num:"0" //秒杀限购数量 0 不限制
mandatory:'2',
linkage_id:'',
//cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
specifications:'',//商品规格
stock:'', //商品库存
cost_price:'', //进货价钱
code:'' ,//条形编码
commission:'', //返佣比例
sell_type:0,// 售卖类型
commodity_data:{}, //原始商品名
quality_guarantee_period:0, //保质期(月)
manufacture_date:'' , //生产日期
manufacturer :'', ///生产厂商
brand :'', // 品牌
checkbox: [],//断选
product_id:"",//修改的时候的产品id
product_name:"",//产品名称
desc:"",//产品描述
cate_id:"",//产品分类id
photo:"",//产品图片
lunch_box_fee:'',//餐盒费
is_new:"",//是否新产品
is_hot:"",//是否热卖产品
action:"add",// 方式(添加:add,修改:edit)
price:"",//价格
activity_price:"",//秒杀价
store_count:"" ,// 秒杀库存
is_seckill:"0",//0 1 是否秒杀产品
activity_id:'0',//秒杀activity_id
activity_list:'',//秒杀列表
limit_num:"0" //秒杀限购数量 0 不限制
},
timeList:[
{}
......@@ -766,7 +765,6 @@
let res = await eleProductInfo({
product_id:this.product_id,
});
console.log(res,'法大师傅大师傅大师傅士大夫大师傅');
if(res.code==0){
this.linkage_product_id = res.data.linkage_product_id
this.bools = res.data.product_name;
......@@ -837,7 +835,6 @@
}else{
this.classValue = '';
}
//属性选默认值
if(res.data.is_new==1){
......@@ -876,17 +873,18 @@
}
},
getForm() {
if(this.isshowsetkilltime && (this.form.activity_price==""||this.form.store_count==""||this.form.limit_num=="") ){
this.$api.msg("请填写完整秒杀数据");
return false;
}
// if(this.isshowsetkilltime && (this.form.activity_price==""||this.form.store_count==""||this.form.limit_num=="") ){
// this.$api.msg("请填写完整秒杀数据");
// return false;
// }
// console.log(this.form.limit_num,this.form.store_count)
// if(!this.isInteger(this.form.limit_num) || !this.isInteger(this.form.store_count)){
// this.$api.msg("秒杀库存或限购数量不能为小数");
// return false;
// }
let can = {
action:this.product_id==''?'add':'edit',
linkage_id:this.linkage_id,
mandatory:this.form.mandatory,
gram:this.form.specifications, //商品规格
......@@ -903,7 +901,6 @@
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,//价格
photo: this.c_pics.length == 0?'': this.c_pics[0].data, //图片
activity_price:this.form.activity_price,//秒杀价
......@@ -913,6 +910,7 @@
limit_num:this.form.limit_num ,//秒杀限购数量
detail_photos:this.detail_photos,//详情图
video_photos:this.video_photos,//轮播图
cate_id:this.form.cate_id,
};
......@@ -942,11 +940,11 @@
can.is_hot = 0;
}
if(this.product_id!="" && this.is_datashow !=false ){
can.action = "edit";
can.product_id = this.product_id;
}
//添加修改外卖产品
addEditEleProduct(can).then((res1)=>{
console.log(res1,'成功了');
if(res1.code==0){
this.$api.msg(res1.msg);
setTimeout(()=>{
......@@ -955,6 +953,8 @@
}else{
this.$api.msg(res1.msg);
}
}).catch(err=>{
console.log(err,'失败了');
})
},
......
......@@ -186,7 +186,7 @@
</navigator>
</view>
<view class="jiu_max" v-if="shop_type == 'goods'">
<view class="jiu_max">
<!-- 商城订单 -->
<navigator url="/pages/order/shopOrder">
<view class="jiu_min">
......@@ -276,42 +276,55 @@
</navigator>
</view>
<!-- hgService.showSafeSetting(); -->
<view class="jiu_max " v-if="is_bld">
<navigator url="/pages/eleProduct/eleProduct?edit=1">
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/editPrice.png" mode=""></image>
</view>
<view>快捷改价</view>
<view class="jiu_max " v-if="is_bld">
<navigator url="/pages/eleProduct/eleProduct?edit=1">
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/editPrice.png" mode=""></image>
</view>
</navigator>
</view>
<view class="jiu_max " v-if="is_bld">
<navigator url="/pages/eleProduct/eleProduct?edit=2">
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/editStore.png" mode=""></image>
</view>
<view>增减库存</view>
<view>快捷改价</view>
</view>
</navigator>
</view>
<view class="jiu_max " v-if="is_bld">
<navigator url="/pages/eleProduct/eleProduct?edit=2">
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/editStore.png" mode=""></image>
</view>
</navigator>
</view>
<view class="jiu_max " @click="download" v-if="is_bld">
<view>
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/download.png" mode=""></image>
</view>
<view>下载称重商品</view>
<view>增减库存</view>
</view>
</navigator>
</view>
<view class="jiu_max " @click="download" v-if="is_bld">
<view>
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/download.png" mode=""></image>
</view>
<view>下载称重商品</view>
</view>
</view>
</view>
<!-- url="/pages/publishActivities/activityList/activityList" -->
<view class="jiu_max ">
<navigator url="/pages/publishActivities/activityList/activityList">
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/download.png" mode=""></image>
</view>
<view>0元领活动</view>
</view>
</navigator>
</view>
</view>
<view class="BH"></view>
<Welcome ref="Welcome"></Welcome>
<!-- 欢迎回来 -->
......@@ -320,7 +333,8 @@
<script>
import {
getskipShop
getskipShop,
activity_nucleus
} from "@/utils/api/merchant.js";
import uniBadge from "@/components/uni/uni-badge/uni-badge.vue"
import uniIcon from "@/components/uni/uni-icon/uni-icon.vue"
......@@ -419,46 +433,85 @@
saoma(e) {
uni.scanCode({
success: res => {
uni.request({
url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。
data: {
barcode: res.result,
needImg: true,
app_id: 'qkkbptetyohxoiod',
app_secret: 'Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09'
},
method: 'GET',
success: (results) => {
console.log(results);
if (results.data.code == 0) {
// this.$api.msg(results.data.msg);
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
} else if (results.data.code == 1) {
if (res.scanType == 'QR_CODE') {
let param = this.GetRequest(res.result);
param.shop_id = this.shop_id
activity_nucleus(param).then(res => {
if (res.code == 0) {
this.$api.msg(res.msg);
}else{
this.$api.msg(res.msg);
}
})
return;
} else if (res.scanType == 'EAN_13') {
uni.request({
url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。
data: {
barcode: res.result,
needImg: true,
app_id: 'qkkbptetyohxoiod',
app_secret: 'Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09'
},
method: 'GET',
success: (results) => {
// console.log(results);
if (results.data.code == 0) {
// this.$api.msg(results.data.msg);
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
} else if (results.data.code == 1) {
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
// console.log(results)
}
},
fail: (results) => {
// console.log(results);
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
console.log(results)
}
})
}
},
fail: (results) => {
console.log(results);
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
}
})
}
});
},
// 解析链接中的参数
/**
* 解析url地址的参数
* @param {string} urlStr
*/
GetRequest: (urlStr) => {
if (typeof urlStr == "undefined") {
var url = decodeURI(location.search); //获取url中"?"符后的字符串
} else {
var url = "?" + urlStr.split("?")[1];
}
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
var strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
}
}
return theRequest;
},
jump() {
uni.navigateTo({
url: '/pages/edit/pro_manage/pro_manage?money_type=' + this.money_type + '&' + 'activity_type=' + this.activity_type
......@@ -471,15 +524,15 @@
})
},
download() {
let that = this
let that = this
uni.showModal({
title: '复制链接在电脑端浏览器打开',
content:`${that.$store.state.uploadurl}api/index/excel?shop_id=${this.shop_id}`,
content: `${that.$store.state.uploadurl}api/index/excel?shop_id=${that.shop_id}`,
confirmText: '复制',
success: function(res) {
if (res.confirm) {
uni.setClipboardData({
data: `${that.$store.state.uploadurl}api/index/excel?shop_id=${this.shop_id}`,
data: `${that.$store.state.uploadurl}api/index/excel?shop_id=${that.shop_id}`,
success: () => { //复制成功的回调函数
uni.showToast({ //提示
title: '复制成功'
......@@ -489,7 +542,7 @@
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
......
<template>
<view>
<view class="">
<view class="" style="text-align: center;height: 120upx;line-height: 120upx;font-weight: bold;font-size: 32upx;">
以有 <text style="color: #21B94C;font-size: 60upx;">150</text>人领取 还剩50人未领取
</view>
</view>
<view class="" style="height: 160upx;padding: 0 24upx;background-color: rgb(255, 255, 255);margin-bottom: 20upx;" v-if="getDetail.length > 0 " v-for="(item,index) in getDetail">
<view class="fx " style="justify-content: space-between;background-color: #fff; align-items: center;
height: 100%">
<view class="fx" style="width: 75%;align-items: center;" >
<view style="height: 120upx;width: 120upx;border-radius: 120upx;text-align: center;line-height: 80upx;overflow: hidden;">
<image :src="item.face" style="display: inline;"></image>
</view>
<view style="margin:0 0 0 10upx;width: 75%;padding: 20upx 10upx;">
<view style="font: 34upx 微软雅黑;padding-bottom:10upx ;" class="oneline">{{item.nickname}}</view>
<view style="font-size:20upx;color:rgb(116, 113, 113);padding-top: 10upx;">{{item.verification_time}}</view>
</view>
</view>
<view style="width: 15%;height: 104upx;">
<!-- <text style="color:#DC143C;padding: 0 12upx;border-radius: 10upx;font-size: 32upx;">
</text> -->
<image src="/static/lingqu.png" mode="" style="width:100% ;height: 100%;display: inline;"></image>
</view>
<!-- 关注插槽 -->
<!-- <slot name="before"></slot> -->
</view>
<!-- <slot name="content"> </slot> -->
</view>
<view v-if="getDetail.length <= 0" style="text-align: center;width: 100%;height:1000upx;line-height: 1000upx;font-size: 50upx;color:#8C8C8C ;">
还没有人领取~~
</view>
</view>
</template>
<script>
import {
activity_user
} from '@/utils/api/merchant.js';
export default {
data(){
return {
shop_id:'',
activity_id:'',
getDetail:[],
page:1
}
},
onReachBottom() {
console.log('触底加载');
activity_user({
shop_id:this.shop_id,
activity_id:this.activity_id,
nucleus:1,
page:this.page
}).then(res=>{
if(res.code==0&&res.data.list.length>0){
this.page++
this.getDetail = res.data.list
uni.stopPullDownRefresh();
}else{
uni.$api.msg('没有更多数据了')
}
})
},
onPullDownRefresh() {
this.page = 1
activity_user({
shop_id:this.shop_id,
activity_id:this.activity_id,
nucleus:1
}).then(res=>{
if(res.code==0){
this.getDetail = res.data.list
uni.stopPullDownRefresh();
}
})
},
onLoad(options) {
let that = this
that.activity_id = options.activity_id
uni.getStorage({
key: 'userInfo',
success(res) {
that.shop_id = res.data.shop_id
}
})
activity_user({
shop_id:that.shop_id,
activity_id:that.activity_id,
nucleus:1
}).then(res=>{
if(res.code==0){
this.getDetail = res.data.list
}
})
},
}
</script>
<style>
page{
background-color: #EEEEEE;
}
.fx {
display: flex;
}
.guanzhu {
padding: 24upx;
border-top: 2upx solid #eee;
/* border-bottom: 1upx solid #eee; */
}
.pd24 {
padding: 24upx
}
</style>
This diff is collapsed.
This diff is collapsed.
......@@ -47,6 +47,60 @@ export function getshopclass(data){
}
/**
* @param {Object} data
*/
//获取分类 列表
export function activity_nucleus(data){
return request.post("/ele/activity_nucleus", data, { noAuth: true});
}
/**
* 添加免费领东西活动
* @param {Object} data
*/
export function activity_add(data){
return request.post("/ele/activity_add", data, { noAuth: true});
}
/**
* 获取活动列表
* @param {Object} data
*/
export function activity_select(data){
return request.post("/ele/activity_select", data, { noAuth: true});
}
/**
* 关闭活动
* @param {Object} data
*/
export function activity_close(data){
return request.post("/ele/activity_close", data, { noAuth: true});
}
/**
* 活动详情
* @param {} data
*/
export function activity_find(data){
return request.post("/ele/activity_find", data, { noAuth: true});
}
/**
*
* @param {} data
*/
export function activity_user(data){
return request.post("/ele/activity_user", data, { noAuth: true});
}
/**
* 修改活动
* @param {} data
*/
export function activity_update(data){
return request.post("/ele/activity_update", data, { noAuth: true});
}
\ No newline at end of file
......@@ -3,19 +3,13 @@
module.exports = {
//是否为开发调试环境 true为本地环境 false 为正式环境
//isdebug:false,//正式
isdebug:true,//测试
// xqdebug:false,//正式权限
xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
isdebug:false,//正式
//isdebug:true,//测试
xqdebug:false,//正式权限
// xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
// #ifdef APP-PLUS
// isdebug:false,//正式 APP里面绝对是正式
// #endif
/**
* PS
......
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