Commit f1fa365d authored by home's avatar home

Merge branch 'zxh' into dev

parents 048f443c ac524802
...@@ -123,7 +123,8 @@ ...@@ -123,7 +123,8 @@
console.log('这里') console.log('这里')
let res = await newsRemind({ let res = await newsRemind({
uid:this.$store.state.userInfo.user_id, uid:this.$store.state.userInfo.user_id,
cid:cid cid:cid,
}); });
if(res.code==0){ 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
...@@ -395,8 +395,31 @@ ...@@ -395,8 +395,31 @@
"navigationBarTitleText": "物流发货", "navigationBarTitleText": "物流发货",
"navigationBarBackgroundColor":"#FFFFFF" "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": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "", "navigationBarTitleText": "",
......
...@@ -158,7 +158,6 @@ ...@@ -158,7 +158,6 @@
<view class="inputbox flex"> <view class="inputbox flex">
<picker mode="date" fields="day" :value="form.manufacture_date" @change="bindDateChange"> <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="请填写生产日期" /> <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> </picker>
</view> </view>
</view> </view>
......
...@@ -276,42 +276,55 @@ ...@@ -276,42 +276,55 @@
</navigator> </navigator>
</view> </view>
<!-- hgService.showSafeSetting(); --> <!-- hgService.showSafeSetting(); -->
<view class="jiu_max " v-if="is_bld"> <view class="jiu_max " v-if="is_bld">
<navigator url="/pages/eleProduct/eleProduct?edit=1"> <navigator url="/pages/eleProduct/eleProduct?edit=1">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/icon/editPrice.png" mode=""></image> <image class="img" src="/static/icon/editPrice.png" mode=""></image>
</view>
<view>快捷改价</view>
</view> </view>
</navigator> <view>快捷改价</view>
</view> </view>
</navigator>
<view class="jiu_max " v-if="is_bld"> </view>
<navigator url="/pages/eleProduct/eleProduct?edit=2">
<view class="jiu_min"> <view class="jiu_max " v-if="is_bld">
<view> <navigator url="/pages/eleProduct/eleProduct?edit=2">
<image class="img" src="/static/icon/editStore.png" mode=""></image> <view class="jiu_min">
</view> <view>
<view>增减库存</view> <image class="img" src="/static/icon/editStore.png" mode=""></image>
</view> </view>
</navigator> <view>增减库存</view>
</view> </view>
</navigator>
</view>
<view class="jiu_max " @click="download" v-if="is_bld">
<view>
<view class="jiu_min"> <view class="jiu_max " @click="download" v-if="is_bld">
<view> <view>
<image class="img" src="/static/icon/download.png" mode=""></image> <view class="jiu_min">
</view> <view>
<view>下载称重商品</view> <image class="img" src="/static/icon/download.png" mode=""></image>
</view> </view>
<view>下载称重商品</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>
<view class="BH"></view> <view class="BH"></view>
<Welcome ref="Welcome"></Welcome> <Welcome ref="Welcome"></Welcome>
<!-- 欢迎回来 --> <!-- 欢迎回来 -->
...@@ -320,7 +333,8 @@ ...@@ -320,7 +333,8 @@
<script> <script>
import { import {
getskipShop getskipShop,
activity_nucleus
} from "@/utils/api/merchant.js"; } from "@/utils/api/merchant.js";
import uniBadge from "@/components/uni/uni-badge/uni-badge.vue" import uniBadge from "@/components/uni/uni-badge/uni-badge.vue"
import uniIcon from "@/components/uni/uni-icon/uni-icon.vue" import uniIcon from "@/components/uni/uni-icon/uni-icon.vue"
...@@ -419,46 +433,85 @@ ...@@ -419,46 +433,85 @@
saoma(e) { saoma(e) {
uni.scanCode({ uni.scanCode({
success: res => { success: res => {
uni.request({ if (res.scanType == 'QR_CODE') {
url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。 let param = this.GetRequest(res.result);
data: { param.shop_id = this.shop_id
barcode: res.result,
needImg: true, activity_nucleus(param).then(res => {
app_id: 'qkkbptetyohxoiod', if (res.code == 0) {
app_secret: 'Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09' this.$api.msg(res.msg);
}, }else{
method: 'GET', this.$api.msg(res.msg);
success: (results) => { }
console.log(results); })
if (results.data.code == 0) { return;
// this.$api.msg(results.data.msg); } else if (res.scanType == 'EAN_13') {
results.isScanCode = false; uni.request({
results.code = res.result; url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。
uni.navigateTo({ data: {
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results) barcode: res.result,
}) needImg: true,
} else if (results.data.code == 1) { 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.isScanCode = false;
results.code = res.result; results.code = res.result;
uni.navigateTo({ uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results) 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() { jump() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/edit/pro_manage/pro_manage?money_type=' + this.money_type + '&' + 'activity_type=' + this.activity_type url: '/pages/edit/pro_manage/pro_manage?money_type=' + this.money_type + '&' + 'activity_type=' + this.activity_type
...@@ -471,15 +524,15 @@ ...@@ -471,15 +524,15 @@
}) })
}, },
download() { download() {
let that = this let that = this
uni.showModal({ uni.showModal({
title: '复制链接在电脑端浏览器打开', 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: '复制', confirmText: '复制',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.setClipboardData({ 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: () => { //复制成功的回调函数 success: () => { //复制成功的回调函数
uni.showToast({ //提示 uni.showToast({ //提示
title: '复制成功' title: '复制成功'
...@@ -489,7 +542,7 @@ ...@@ -489,7 +542,7 @@
console.log('用户点击确定'); console.log('用户点击确定');
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); 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){ ...@@ -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
...@@ -5,9 +5,9 @@ module.exports = { ...@@ -5,9 +5,9 @@ module.exports = {
isdebug:false,//正式 // isdebug:false,//正式
// isdebug:true,//测试 isdebug:true,//测试
xqdebug:false,//正式权限 xqdebug:false,//正式权限
......
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