Commit 9bf9324a by wwh

update

1 parent 93378c7d
Showing with 4904 additions and 0 deletions
module.exports = {
root: true,
// parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',
// required to lint *.wpy files
plugins: [
'html'
],
settings: {
'html/html-extensions': ['.html', '.wpy']
},
// add your custom rules here
'rules': {
"semi": [0],
// allow paren-less arrow functions
'arrow-parens': 0,
// allow async-await
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'space-before-function-paren': 0,
'eqeqeq': [0]
}
}
node_modules/*
dist/*
.idea/*
/.editorconfig
/.eslintignore
/.npmignore
/.wepycache
/.wepyignore
/package-lock.json
/src/ext.json
\ No newline at end of file
MIT License
Copyright (c) 2017 Huang WeiMing
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"name": "test",
"version": "1.2.8",
"description": "",
"main": "dist/app.js",
"scripts": {
"dev": "wepy build --watch",
"build": "cross-env NODE_ENV=production wepy build --no-cache",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",
"dependencies": {
"crypto-js": "^3.1.9-1",
"promise-polyfill": "^8.1.0",
"wepy": "^1.7.2",
"wepy-async-function": "^1.4.4",
"wepy-cli": "^1.6.1-alpha4",
"wepy-com-toast": "^1.0.2",
"wepy-redux": "^1.5.3"
},
"devDependencies": {
"babel-eslint": "^7.2.1",
"babel-plugin-syntax-export-extensions": "^6.13.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-export-extensions": "^6.22.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"cross-env": "^5.0.1",
"eslint": "^3.18.0",
"eslint-config-standard": "^7.1.0",
"eslint-friendly-formatter": "^2.0.7",
"eslint-plugin-html": "^2.0.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^2.0.1",
"less": "^3.9.0",
"wepy-compiler-babel": "^1.5.3",
"wepy-compiler-less": "^1.3.14",
"wepy-compiler-sass": "^1.3.12",
"wepy-eslint": "^1.5.2",
"wepy-plugin-autoprefixer": "^1.5.10",
"wepy-plugin-filemin": "^1.3.12",
"wepy-plugin-imagemin": "^1.5.2",
"wepy-plugin-uglifyjs": "^1.3.6"
}
}
import base from './base'
import wepy from 'wepy';
import Tips from '../utils/Tips'
export default class auth extends base {
/**
* 检查登录状态
*/
static isLogin() {
const loginCode = this.getConfig('login_code');
return loginCode != null;
}
/**
* 登录
*/
static async login(phone, code) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/login/run`;
const dara = await this.post(url,{name: phone, password: code,source:'lite'});
wx.setStorageSync('token', dara.data.authorize.token);
wx.setStorageSync('logintoken', dara.data.authorize.token);
wx.setStorageSync('authorize',dara.data.authorize)
return dara.error;
}
/**
* 短信验证码
*/
static async sms (phone) {
const url = `${this.baseUrl}/business/register/send?phone=${phone}`;
const data = await this.post(url);
return data.message;
}
/**
* 获取openId
*/
static async getOpenid (data) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/wechat/merchantLiveOpenid`;
return await this.post(url, data);
}
/**
* 发送formId
*/
static async sendFormid (data) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/wechat/formId`;
return await this.post(url, data);
}
/**
* 检查登录情况
*/
static async check(loginCode) {
const url = `${this.baseUrl}/auth/check?login_code=${loginCode}`;
const data = await this.get(url);
return data.result;
}
/**
* 设置权限值
*/
static getConfig(key) {
return wepy.$instance.globalData.auth[key];
}
/**
* 选择店铺
*/
static async setConfig(key, value) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/switch?mtoken=${value}`;
const dara = await this.post(url);
wx.setStorageSync('token', dara.data.authorize.token);
wx.setStorageSync('mtoken', dara.data.mtoken);
return dara
}
/**
* 选择店铺
*/
static async setConfig_v2(key, value,unique_id,password) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/switch/v2?mtoken=${value}&unique_id=${unique_id}&password=${password}`;
const dara = await this.post(url);
if(dara.data && dara.data.authorize) {
wx.setStorageSync('token', dara.data.authorize.token);
wx.setStorageSync('mtoken', dara.data.mtoken);
}else {
Tips.toast(dara.error_reason,'none','none');
}
return dara
}
/**
* 删除权限值
*/
static async removeConfig(key) {
wepy.$instance.globalData.auth[key] = null;
await wepy.removeStorage({key: key});
}
/**
* 删除权限值
*/
static async removeToken(key) {
// wepy.$instance.globalData.auth[key] = null;
await wepy.removeStorage({key: key});
}
/**
* 删除权限值
*/
static async removeMtoken(key) {
// wepy.$instance.globalData.auth[key] = null;
await wepy.removeStorage({key: key});
}
}
import wepy from 'wepy';
import http from '../utils/Http'
export default class base {
static baseUrl = wepy.$instance.globalData.baseUrl;
static loginUrl = wepy.$instance.globalData.loginUrl;
static baseUrlnew = wepy.$instance.globalData.baseUrlnew;
static baseUrlCater = wepy.$instance.globalData.baseUrlCater;
static baseUrlCater1 = wepy.$instance.globalData.baseUrlCater1;
static openUrl = wepy.$instance.globalData.openUrl;
static get = http.get.bind(http);
static put = http.put.bind(http);
static post = http.post.bind(http);
static delete = http.delete.bind(http);
static gtBaseUrl() {
// return wx.getStorageSync('tag') == 1 ? wepy.$instance.globalData.gtBaseUrl : wepy.$instance.globalData.gtBaseUrlOld;
return wepy.$instance.globalData.gtBaseUrl
}
}
import base from './base';
import Page from '../utils/Page';
import wepy from 'wepy';
export default class comment extends base {
/**
* 分页方法
*/
static page () {
const url = `${this.baseUrl}/comments`;
return new Page(url, this._processGoodsComment.bind(this));
}
/**
* 创建
*/
static async create(comments) {
const url = `${this.baseUrl}/comments`;
return await this.post(url, comments);
}
/**
* 评价统计
*/
static async count(goodsId) {
const url = `${this.baseUrl}/comments/count?goods_id=${goodsId}`;
return await this.get(url);
}
/**
* 处理评价列表数据
*/
static _processGoodsComment(data) {
const comment = {};
comment.createTime = data.createTime.substring(0, 10);
comment.createTime_comment = data.createTime.substring(0, 16);
comment.starArr = [0, 0, 0, 0, 0];
for (let i = 0; i < data.star; i++) {
comment.starArr[i] = 1;
}
comment.star = data.star;
comment.avatar = data.customer.avatarUrl;
comment.nickName = data.customer.nickName;
comment.comment = data.comment;
comment.good_image = data.goods.images[0].url;
comment.good_name = data.goods.name;
return comment;
}
/**
* 商品评价列表
*/
static async getCommentList(data) {
const url = `${this.baseUrl}/orders/OrderEvaluate/listEvaluate`;
return await this.post(url, data);
}
/**
* 商家回复评论
*/
static async replyComment(data) {
const url = `${this.baseUrl}/orders/OrderEvaluate/replyEvaluate`;
return await this.post(url, data);
}
}
import base from './base';
import Page from '../utils/Page';
export default class order extends base {
/**
* 活动列表
*/
static async getActiveList(data) {
const url = `${this.baseUrl}/Storemarketing/CommunityActivity/mpList`;
return await this.post(url,data);
}
/**
* 删除活动
*/
static async deleteActive(data) {
const url = `${this.baseUrl}/Storemarketing/CommunityActivity/deleteActivity`;
return await this.post(url,data);
}
/**
* 活动数据
*/
static async activeData(data) {
const url = `${this.baseUrl}/Storemarketing/CommunityActivity/activityDetailStatistics`;
return await this.post(url,data);
}
/**
* 发货单 自提点列表
*/
static async headList(data) {
const url = `${this.baseUrl}/Storemarketing/CommunitySelfLift/headList`;
return await this.post(url,data);
}
/**
* 发货单 自提点商品列表
*/
static async productList(data) {
const url = `${this.baseUrl}/orders/activity/invoice`;
return await this.post(url,data);
}
/**
* 发货状态
*/
static async invoiceLog(data) {
const url = `${this.baseUrl}/storemarketing/CommunitySelfLift/invoiceLog`;
return await this.post(url,data);
}
/**
* 发货
*/
static async invoiceStart(data) {
const url = `${this.baseUrl}/storemarketing/CommunitySelfLift/invoiceStart`;
return await this.post(url,data);
}
/**
* 获取活动信息
*/
static async getActiveInfo(data) {
const url = `${this.baseUrl}/Storemarketing/CommunityActivity/getOne`;
return await this.post(url,data);
}
/**
* 为商品创建直播信息
*/
static async createLive(data) {
const url = `${this.baseUrl}/Storemarketing/CommunityComments/createLive`;
return await this.post(url,data);
}
/**
* 获取一个活动下一个商品的直播列表
*/
static async productLivesList(data) {
const url = `${this.baseUrl}/Storemarketing/CommunityComments/lives`;
return await this.post(url,data);
}
}
\ No newline at end of file
import base from './base';
export default class count extends base {
/**
* 今日统计
*/
static async today() {
return await this.count('TODAY');
}
/**
* 今日统计
*/
static async month() {
return await this.count('MONTH');
}
/**
* 订单统计
*/
static async order() {
const url = `${this.baseUrl}/count/order`;
const data = await this.get(url);
const result = {};
for (let i = 1; i <= 9; i++) {
const item = data.find(item => item.status == i);
result[`n${i}`] = item != null ? item.total : 0;
}
return result;
}
/**
* 统计
*/
static async count(type) {
const url = `${this.baseUrl}/count?count_type=${type}`;
const data = await this.get(url);
return this._processCount(data);
}
/**
* 结果处理
*/
static _processCount(data) {
data.income = parseFloat(data.income).toFixed(2);
return data;
}
}
import base from './base';
import Page from '../utils/Page';
export default class coupon extends base {
/**
* 客户历史订单分页
* @param customerId
* @returns {Promise.<Pagination>}
*/
static async cutomerCouponPage(customerId) {
const url = `${this.baseUrl}/customers/${customerId}/coupon_list`;
return new Page(url, this._processCustomerCouponItem.bind(this));
}
/**
* 处理客户优惠券
* @param item
* @private
*/
static _processCustomerCouponItem(item) {
if (item.coupon == null) {
return;
}
Object.assign(item, item.coupon);
item.acceptTime = this._convertTimestapeToDay(item.acceptTime);
item.beginTime = this._convertTimestapeToDay(item.beginTime);
item.dueTime = this._convertTimestapeToDay(item.dueTime);
item.name = item.name ? item.name : '优惠券';
switch (item.status) {
case 'USED':
item.status = '已使用';
break;
case 'NEVER_USED':
item.status = '未使用';
break;
case 'EXPIRED':
item.status = '已过期';
break;
default:
item.status = '已失效'
}
}
/**
* 分页方法
*/
static page() {
const url = `${this.baseUrl}/storemarketing/MarketingActive/couponMerchantList`;
return new Page(url, this.processCouponItem.bind(this));
}
/**
* 优惠券使用情况分页方法
*/
static pagePick(couponId, type) {
if (type == 'NEVER_USED') {
const url = `${this.baseUrl}/coupons/${couponId}/used_info`;
return new Page(url, this.processCouponNeverUsed.bind(this));
} else {
const url = `${this.baseUrl}/coupons/${couponId}/used_info`;
return new Page(url, this.processCouponUsed.bind(this));
}
}
/**
* 新增卡券
*/
static async create(coupon) {
const url = `${this.baseUrl}/coupons`;
return await this.post(url, coupon);
}
/**
* 删除卡券
*/
static async remove(couponId) {
const url = `${this.baseUrl}/coupons/${couponId}`;
return await this.delete(url);
}
/**
* 查询核销码信息
*/
static info(couponId) {
const url = `${this.baseUrl}/orders/Orders/verification`;
return this.get(url, couponId);
}
static infoitem(couponId) {
const url = `${this.baseUrl}/orders/Orders/varCardInfo`;
return this.get(url, couponId);
}
/**
* 核销商品
*/
static infoset(couponId) {
const url = `${this.baseUrl}/orders/Orders/verification`;
return this.post(url, couponId);
}
/**
* 查询商品二级分类
*/
static getClassify(couponId) {
const url = `${this.baseUrl}/storeproducts/ProductClassify/list`;
return this.post(url, couponId);
}
/**
* 编辑卡券
*/
static async update(couponId, coupon) {
const url = `${this.baseUrl}/coupons/${couponId}`;
return await this.put(url, coupon);
}
/**
* 使用卡券
*/
static async use(id) {
const url = `${this.baseUrl}/coupons/use/${id}`;
return await this.put(url);
}
/**
* 获取优惠券列表 餐饮版
*/
static async getCouponlist(data) {
const url = `${this.baseUrlCater1}/cateringmarketing/MarketingActivity/couponMerchantList`;
return await this.post(url, data);
}
/**
* 数据处理
*/
static processCouponItem(coupon) {
if (coupon == null) {
return;
}
coupon.beginTime = this._convertTimestapeToDay(coupon.beginTime);
coupon.dueTime = this._convertTimestapeToDay(coupon.dueTime);
coupon.name = coupon.name ? coupon.name : '优惠券';
}
/**
* 优惠券使用未使用情况数据处理
*/
static processCouponNeverUsed(item) {
const coupon = {};
if (item.customer) {
coupon.name = item.customer.nickName;
coupon.avatar = item.customer.avatarUrl;
}
coupon.key = '领取时间';
coupon.value = item.acceptTime;
return coupon;
}
/**
* 优惠券使用已使用情况数据处理
*/
static processCouponUsed(item) {
const coupon = {};
if (item.customer) {
coupon.name = item.customer.nickName;
coupon.avatar = item.customer.avatarUrl;
}
coupon.key = '使用时间';
coupon.value = item.usedTime;
return coupon;
}
/**
* 处理时间格式
*/
static _convertTimestapeToDay(timestape) {
if (timestape == null) {
return;
}
let temp = timestape;
if (timestape.indexOf(' ') != -1) {
temp = timestape.substring(0, timestape.indexOf(' '));
}
return temp.replace(/-/g, '.');
}
/**
* 卖家发放优惠券给买家数据处理
*/
static async send(coupon) {
const url = `${this.baseUrl}/coupons/send`;
return await this.post(url, coupon);
}
static async getCard(data) {
const url = `${this.baseUrl}/storemarketing/GiftCard/checkGiftCardShow`;
return await this.post(url, data);
}
static async endCard(data) {
const url = `${this.baseUrl}/storemarketing/GiftCard/cardCheck`;
return await this.post(url, data);
}
}
import base from './base';
import wepy from 'wepy';
export default class customer extends base {
/**
** 获取优惠券列表
*/
static async getCouponList (params) {
const url = `${this.baseUrl}/storemarketing/Coupon/couponList`;
return await this.post(url, params);
}
/**
** 新建优惠券
*/
static async createCoupon (params) {
const url = `${this.baseUrl}/storemarketing/Coupon/couponManage`;
return await this.post(url, params);
}
/**
** 暂停或启动优惠券
*/
static async openCloseCoupon (params) {
const url = `${this.baseUrl}/storemarketing/Coupon/delCoupon`;
return await this.post(url, params);
}
/**
**优惠券详情
*/
static async couponDetail (params) {
const url = `${this.baseUrl}/storemarketing/Coupon/couponList`;
return await this.post(url, params);
}
}
\ No newline at end of file
import base from './base';
import wepy from 'wepy';
export default class customer extends base {
/**
** 获取用户列表
*/
static async getUserList (params) {
const url = `${this.loginUrl}/cateringusers/StoreUsers/userList`;
return await this.post(url, params);
}
/**
** 获取用户详情
*/
static async getUserDetail (params) {
const url = `${this.loginUrl}/cateringusers/StoreUsers/userInfo`;
return await this.post(url, params);
}
/**
** 查询用户最近交易数据
*/
static async userStatistic (params) {
const url = `${this.baseUrl}/orders/dataCenter/userStatistic`;
return await this.post(url, params);
}
/**
** 查询标签列表
*/
static async getLabelList (params) {
const url = `${this.loginUrl}/cateringusers/StoreUsersTags/storeTags`;
return await this.post(url, params);
}
/**
** 用户添加标签
*/
static async addUserLabel (params) {
const url = `${this.loginUrl}/cateringusers/StoreUsersTags/createUserTags`;
return await this.post(url, params);
}
/**
** 用户储值
*/
static async addValueCardValue (params) {
const url = `${this.loginUrl}/cateringusers/StoreUsersCardTrade/createRechargeOrder`;
return await this.post(url, params);
}
/**
** 修改用户积分
*/
static async amendUserPoint (params) {
const url = `${this.loginUrl}/cateringusers/StoreUsersPoint/storePointValue`;
return await this.post(url, params);
}
/**
**获取会员等级
*/
static async getCustomerLever(params) {
const url = `${this.loginUrl}/cateringusers/StoreUsersLevel/levelList`;
return await this.post(url, params);
}
/**
**获取会员等级
*/
static async editCustomerLevel(params) {
const url = `${this.loginUrl}/cateringusers/StoreUsersLevel/storeLevelValue`;
return await this.post(url, params);
}
/**
**获取用户优惠券列表
*/
static async getUserCouponList(params) {
const url = `${this.baseUrl}/storemarketing/MarketingActive/userVouchersShow`;
return await this.post(url, params);
}
/**
**获取赠送优惠券列表
*/
static async getSendCouponList(params) {
const url = `${this.baseUrl}/storemarketing/Coupon/useCouponList`;
return await this.post(url, params);
}
/**
**获取用户剩余短信条数storemarketing/coupon/giving
*/
static async getUserNote(params) {
const url = `${this.loginUrl}/messages/sms/info`;
return await this.post(url, params);
}
/**
**获取用户剩余短信条数
*/
static async sendCouponToUser(params) {
const url = `${this.baseUrl}/storemarketing/coupon/giving`;
return await this.post(url, params);
}
}
\ No newline at end of file
import base from './base';
import Page from '../utils/Page';
export default class customerInfo extends base {
/**
* 根据客户发放优惠券
* @param params(couponId, cusomterId)
*/
static async sendCoupon(params) {
const url = `${this.baseUrl}/coupons/send`;
return await this.post(url, params);
}
/**
* 获取客户地址
* @param customerId
* @returns {Promise.<TResult>}
*/
static async addressList(customerId) {
const url = `${this.baseUrl}/customers/${customerId}/detail_info`;
return this.get(url).then(data => {
data.addressList.forEach(v => {
if (v.sex == '1') {
v.name += ' 先生';
} else {
v.name += ' 女士';
}
});
return data.addressList;
});
}
/**
* 获取客户详细信息
*/
static async detailInfo(customerId) {
const url = `${this.baseUrl}/customers/${customerId}/detail_info`;
return this.get(url).then(data => {
if (data.message) {
return Promise.reject(new Error(data.message));
}
let price = data.countCustomerInfo.totalPrice;
if (price > 1000 * 1000) {
data.countCustomerInfo.totalPrice = (price / 1000).toFixed(2) + 'k';
}
const lastTime = data.countCustomerInfo.lastOrderTime;
data.countCustomerInfo.lastOrderTime = this._dealDate(lastTime);
data.address = this._dealAddres(data.addressList);
return data;
});
}
/**
* 处理日期为 MM/DD
* @param date
* @returns {string}
* @private
*/
static _dealDate(date) {
try {
return date.substring(5, 10).replace('-', '/');
} catch (e) {
return '-';
}
}
/**
* 过滤地址为isDefault = 1,若无则为第一个
* @param addressList
* @returns {*}
* @private
*/
static _dealAddres(addressList) {
if (addressList && addressList.length > 0) {
let address;
let arr = addressList.filter(v => v.isDefault == '1');
if (arr.length > 0) {
address = arr[0];
} else {
address = addressList[0];
}
return address;
} else {
return null;
}
}
}
import base from './base';
import Page from '../utils/Page';
import wepy from "wepy";
export default class customerService extends base {
/**
* 聊天记录
* */
static async chatHistory(openId) {
const url = `${this.baseUrl}/kefu/chat_history?open_id=${openId}`;
const data = await this.get(url);
return this.processChatHistoryTransformation(data);
}
/**
* 客服列表
* */
static async chatList(data) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/Customer/conversationLists`;
return await this.post(url, data);
}
/**
* 客服回话列表
* */
static async dialogueList(data) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/Customer/dialogueList`;
return await this.post(url, data);
}
/**
* 发送消息
* */
static async sendMessage(data) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/customer/notify/socket`;
return await this.post(url, data);
}
/**
* client_id绑定
* */
static async clientIdBind(data) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/Customer/clientBind`;
return await this.post(url, data);
}
/**
* 聊天信息处理
* */
static processChatInfoTransformation(chatInfo) {
const params = {};
if (chatInfo.mpMsg.msgTime != null) {
params.msgTime = chatInfo.mpMsg.msgTime.substring(10, 16);
} else {
params.msgTime = '';
}
params.content = chatInfo.mpMsg.content;
params.nickName = chatInfo.nickName;
params.avatarUrl = chatInfo.avatarUrl;
params.openId = chatInfo.openId;
return params;
}
/**
* 聊天历史记录
* */
static processChatHistoryTransformation (chatHistory) {
var params = [];
params = chatHistory;
chatHistory.forEach((item, index) => {
params[index].content = item.content;
if (item.msgSource == 1) {
params[index].from = 'me';
} else {
params[index].from = 'orther'
}
});
return params;
}
}
import base from './base';
import Page from '../utils/Page';
export default class delivery extends base {
/**
* 分页方法
*/
static page () {
const url = `${this.baseUrl}/delivery`;
return new Page(url);
}
/**
* 创建
*/
static create(delivery) {
const url = `${this.baseUrl}/delivery`;
return this.post(url, [delivery]);
}
/**
* 删除
*/
static remove(id) {
const url = `${this.baseUrl}/delivery/${id}`;
return this.delete(url);
}
/**
* 更新
*/
static update(id, delivery) {
const url = `${this.baseUrl}/delivery/${id}`;
return this.put(url, delivery);
}
/**
* 配送员列表
*/
static listDeliver () {
const url = `${this.baseUrl}/deliver_user`;
return this.get(url).then(data => {
data.forEach(v => {
v.showText = `${v.name} (${v.phone})`
});
return data;
});
}
/**
* 创建
*/
static createDeliver(deliver) {
const url = `${this.baseUrl}/deliver_user`;
return this.post(url, deliver);
}
/**
* 删除
*/
static removeDeliver(id) {
const url = `${this.baseUrl}/deliver_user/${id}`;
return this.delete(url);
}
/**
* 更新
*/
static updateDeliver(deliver) {
const url = `${this.baseUrl}/deliver_user`;
return this.put(url, deliver);
}
}
import base from './base';
export default class order extends base {
/**
* 查询快递公司列表
*/
static async company() {
const url = `${this.baseUrl}/express/company`;
return await this.get(url);
}
/**
* 构造当前物流状态
*/
static createCurrentTrace(express) {
if (express == null) {
return;
}
const steps = express.expressBases;
if (steps == null || steps.length < 1) {
return { text: '尚未查询到物流信息' };
}
const currentStep = steps[0];
return {
text: currentStep.status,
timestape: currentStep.time
};
}
/**
* 查询订单当前的物流状态
*/
static queryCurrentTrace(orderId) {
return this._queryExpressInfo(orderId).then(express => {
return this.createCurrentTrace(express);
});
}
/**
* 构造订单跟踪李彪
*/
static createTrace(express) {
if (express == null) {
return;
}
const info = this._createExpressInfo(express);
const steps = this._createTraceSteps(express);
return {
steps: steps,
info: info
};
}
/**
* 查询订单跟踪列表
*/
static queryTrace(orderId) {
return this._queryExpressInfo(orderId).then(data => this.createTrace(data));
}
/** ********************* 对象构造方法 ***********************/
/**
* 创建物流页面展现的基本信息
*/
static createExpressOrderPreview(order) {
const imageUrl = order.orderGoodsInfos[0].imageUrl;
const goodsCount = order.orderGoodsInfos.length;
return {
imageUrl: imageUrl,
goodsCount: goodsCount,
orderId: order.orderId
}
}
/** ********************* 数据处理方法 ***********************/
/**
* 查询物流信息
*/
static _queryExpressInfo(orderId) {
const url = `${this.baseUrl}/express`;
const param = { order_id: orderId };
return this.get(url, param);
}
/**
* 提取步骤信息
*/
static _createTraceSteps(data) {
if (!data.expressBases) {
return null;
}
// 映射每个步骤
const steps = data.expressBases.map(this._processTraceStep);
// 改变最后一个状态
const lastStep = steps[0];
lastStep.done = true;
lastStep.current = true;
return steps;
}
/**
* 处理每个步骤
*/
static _processTraceStep(item) {
return {
text: item.status,
timestape: item.time,
done: false,
current: false
};
}
/**
* 提取物流基本信息
*/
static _createExpressInfo(data) {
if (data.status == null) {
data.status = '待揽收';
}
return {
expTextName: data.expressType,
mailNo: data.expressNo,
status: data.status,
tel: data.telPhone
}
}
}
import base from '../base';
export default class Finance extends base {
/**
* 执行提现
* @param params
*/
static doTixian(params) {
const url = `${this.loginUrl}/business/Settlement/cash`;
return this.post(url, params);
}
/**
* 提现列表
* @param params
*/
static tixianList(params) {
const url = `${this.loginUrl}/business/settlement/cashList`;
return this.post(url, params);
}
/**
* 资产信息
* @param params
*/
static financeInfo(params = {}) {
const url = `${this.loginUrl}/business/Settlement/cashInfo`;
return this.post(url, params);
}
//获取当前用户的授权信息(提现用到,需先判断授权状态)
static getUserH5AuthLinkAPI(params = {}) {
const url = `${this.loginUrl}/`;
return this.post(url, params);
}
//提交用户的结算账户信息
static sumbitUserInfo(params={}){
const url = `${this.loginUrl}/business/MallWithdraw/edit`;
return this.post(url, params);
}
//查看用户的结算账户信息
static GetCashInfo(params={}){
const url = `${this.loginUrl}/business/MallWithdraw/info`;
return this.post(url, params);
}
//获取微信二维码
static GetAuthQrcode(params={}){
const url = `${this.gtBaseUrl()}/funds/official/authQrcode`;
return this.post(url, params);
}
//轮询获取二维码结果
static resultAuthQrcode(params={}){
const url = `${this.gtBaseUrl()}/funds/official/authNotify`;
return this.post(url, params);
}
//解除绑定
static unbindAuth(params={}){
const url = `${this.loginUrl}/business/MallWithdraw/unbind`;
return this.post(url, params);
}
//跳转支付
static JumpAuthPay(params={}){
const url = `${this.gtBaseUrl()}/funds/Payofficial/authSpliceUrl`;
return this.post(url, params);
}
}
import wepy from 'wepy';
import base from '../base';
import Page from '../../utils/Page';
export default class coupon extends base {
/**
* 客户历史订单分页
* @param customerId
* @returns {Promise.<Pagination>}
*/
static async cutomerCouponPage(customerId) {
const url = `${base.gtBaseUrl()}/customers/${customerId}/coupon_list`;
return new Page(url, this._processCustomerCouponItem.bind(this));
}
/**
* 处理客户优惠券
* @param item
* @private
*/
static _processCustomerCouponItem(item) {
if (item.coupon == null) {
return;
}
Object.assign(item, item.coupon);
item.acceptTime = this._convertTimestapeToDay(item.acceptTime);
item.beginTime = this._convertTimestapeToDay(item.beginTime);
item.dueTime = this._convertTimestapeToDay(item.dueTime);
item.name = item.name ? item.name : '优惠券';
switch (item.status) {
case 'USED':
item.status = '已使用';
break;
case 'NEVER_USED':
item.status = '未使用';
break;
case 'EXPIRED':
item.status = '已过期';
break;
default:
item.status = '已失效'
}
}
/**
* 分页方法
*/
static page() {
const url = `${base.gtBaseUrl()}/storemarketing/MarketingActive/couponMerchantList`;
return new Page(url, this.processCouponItem.bind(this));
}
/**
* 优惠券使用情况分页方法
*/
static pagePick(couponId, type) {
if (type == 'NEVER_USED') {
const url = `${base.gtBaseUrl()}/coupons/${couponId}/used_info`;
return new Page(url, this.processCouponNeverUsed.bind(this));
} else {
const url = `${base.gtBaseUrl()}/coupons/${couponId}/used_info`;
return new Page(url, this.processCouponUsed.bind(this));
}
}
/**
* 新增卡券
*/
static async create(coupon) {
const url = `${base.gtBaseUrl()}/coupons`;
return await this.post(url, coupon);
}
/**
* 删除卡券
*/
static async remove(couponId) {
const url = `${base.gtBaseUrl()}/coupons/${couponId}`;
return await this.delete(url);
}
/**
* 查询核销码信息
*/
static info(couponId) {
// let baseUrl = base.gtBaseUrl();
// if(wx.getStorageSync('tag') === '2'){
// baseUrl = 'https://api.store.ledianyun.com';
// }
// const url = `${baseUrl}/orders/Orders/verification`;
// return this.get(url, couponId);
let mtoken = wepy.$instance.globalData.siteMtoken;
let token = wepy.$instance.globalData.siteToken;
let url = base.gtBaseUrl() === 'https://gt.ledianyun.com/api' ? 'https://api.store.ledianyun.com':base.gtBaseUrl(); //兼容旧版本部分接口使用api.store接口
url = `${url}/orders/Orders/verification`;
return this.get(url, couponId);
}
static infoitem(couponId) {
const url = `${base.gtBaseUrl()}/orders/Orders/varCardInfo`;
return this.get(url, couponId);
}
/**
* 核销商品
*/
static infoset(couponId) {
let url = base.gtBaseUrl() === 'https://gt.ledianyun.com/api' ? 'https://api.store.ledianyun.com':base.gtBaseUrl(); //兼容旧版本部分接口使用api.store接口
url = `${url}/orders/Orders/verification`;
return this.post(url, couponId);
}
/**
* 查询商品二级分类
*/
static getClassify(couponId) {
const url = `${base.gtBaseUrl()}/storeproducts/ProductClassify/list`;
return this.post(url, couponId);
}
/**
* 编辑卡券
*/
static async update(couponId, coupon) {
const url = `${base.gtBaseUrl()}/coupons/${couponId}`;
return await this.put(url, coupon);
}
/**
* 使用卡券
*/
static async use(id) {
const url = `${base.gtBaseUrl()}/coupons/use/${id}`;
return await this.put(url);
}
/**
* 获取优惠券列表 餐饮版
*/
static async getCouponlist(data) {
const url = `${this.gtBaseUrlCater1}/cateringmarketing/MarketingActivity/couponMerchantList`;
return await this.post(url, data);
}
/**
* 数据处理
*/
static processCouponItem(coupon) {
if (coupon == null) {
return;
}
coupon.beginTime = this._convertTimestapeToDay(coupon.beginTime);
coupon.dueTime = this._convertTimestapeToDay(coupon.dueTime);
coupon.name = coupon.name ? coupon.name : '优惠券';
}
/**
* 优惠券使用未使用情况数据处理
*/
static processCouponNeverUsed(item) {
const coupon = {};
if (item.customer) {
coupon.name = item.customer.nickName;
coupon.avatar = item.customer.avatarUrl;
}
coupon.key = '领取时间';
coupon.value = item.acceptTime;
return coupon;
}
/**
* 优惠券使用已使用情况数据处理
*/
static processCouponUsed(item) {
const coupon = {};
if (item.customer) {
coupon.name = item.customer.nickName;
coupon.avatar = item.customer.avatarUrl;
}
coupon.key = '使用时间';
coupon.value = item.usedTime;
return coupon;
}
/**
* 处理时间格式
*/
static _convertTimestapeToDay(timestape) {
if (timestape == null) {
return;
}
let temp = timestape;
if (timestape.indexOf(' ') != -1) {
temp = timestape.substring(0, timestape.indexOf(' '));
}
return temp.replace(/-/g, '.');
}
/**
* 卖家发放优惠券给买家数据处理
*/
static async send(coupon) {
const url = `${base.gtBaseUrl()}/coupons/send`;
return await this.post(url, coupon);
}
static async getCard(data) {
const url = `${base.gtBaseUrl()}/storemarketing/GiftCard/checkGiftCardShow`;
return await this.post(url, data);
}
static async endCard(data) {
const url = `${base.gtBaseUrl()}/storemarketing/GiftCard/cardCheck`;
return await this.post(url, data);
}
}
import wepy from 'wepy';
import base from '../base';
export default class Finance extends base {
/**
* 执行提现
* @param params
*/
static doTixian(params) {
const url = `${base.gtBaseUrl()}/business/Settlement/cash`;
params.mtoken = wepy.$instance.globalData.siteMtoken;
params.token = wepy.$instance.globalData.siteToken;
return this.post(url, params);
}
/**
* 提现列表
* @param params
*/
static tixianList(params) {
const url = `${base.gtBaseUrl()}/business/settlement/cashList`;
params.mtoken = wepy.$instance.globalData.siteMtoken;
params.token = wepy.$instance.globalData.siteToken;
return this.post(url, params);
}
/**
* 资产信息
* @param params
*/
static financeInfo(params = {}) {
const url = `${base.gtBaseUrl()}/business/Settlement/cashInfo`;
params.mtoken = wepy.$instance.globalData.siteMtoken;
params.token = wepy.$instance.globalData.siteToken;
return this.post(url, params);
}
//获取当前站点列表
static siteList(params = {}) {
const url = `${this.loginUrl}/business/Beego/storeLists`;
return this.post(url, params);
}
}
import base from '../base';
import wepy from 'wepy';
export default class shop extends base {
static autoVersion = {
'1': '推广普及版',
'2': '会员普及版',
'3': '会员年费版',
'4': '电商普及版',
'5': '电商年费版',
'6': '全能普及版',
'7': '全能年费版'
};
static autoCofig = {
'1': ['order', 'manusl', 'delivery', 'vip', 'discount', 'add', 'deliveryUser'],
'2': ['order', 'manusl', 'delivery', 'discount'],
'3': ['order', 'manusl', 'delivery', 'discount'],
'4': ['vip', 'add'],
'5': ['vip', 'add'],
'6': [],
'7': []
};
/**
* 获取限制信息
*/
static async limit () {
const url = `${this.baseUrl}/shop_charge_limit`;
const data = await this.get(url);
return this._processVersionText(data);
}
/**
* 获取卖家的店铺列表
*/
static async list (params) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/getList`;
return await this.post(url, params);
}
/**
* 获取卖家的店铺列表
*/
static async list_v2 (params) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/lists/v2`;
return await this.post(url, params);
}
/**
* 获取消息通知列表
*/
static async getMessageList (params) {
// const url = `http://api.xuetang.test.ledianyun.com/lestore/notices/noticeLists`;
const url = `https://xuetang.api.ledianyun.com/lestore/notices/noticeLists`;
return await this.post(url, params);
}
/**
* 获取消息通知详情
*/
static async getMessageDetail (params) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/official/spliceUrl`;
return await this.post(url, params);
}
/**
* 获取店铺首页数据 餐饮版
*/
static async getShopInfo(data){
const url = `${this.baseUrlCater1}/cateringorders/manage/profile`;
return await this.post(url, data);
}
/**
* 获取店铺信息 餐饮版
*/
static async getShopCaterInfo(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingStoreInfo/display`;
return await this.post(url, data);
}
/**
* 编辑店铺信息 餐饮版
*/
static async setShopCaterInfo(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingStoreInfo/saveOne`;
return await this.post(url, data);
}
/**
* 获取店铺堂食开启状态 餐饮版
*/
static async getShopTangOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingGetFoodNum/enable`;
return await this.post(url, data);
}
/**
* 获取店铺外卖开启状态 餐饮版
*/
static async getShopWaiOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingOutset/querySet`;
return await this.post(url, data);
}
/**
* 设置店铺堂食开启状态 餐饮版
*/
static async setShopTangOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingGetFoodNum/setFoodNum`;
return await this.post(url, data);
}
/**
* 设置店铺外卖开启状态 餐饮版
*/
static async setShopWaiOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingOutset/editSet`;
return await this.post(url, data);
}
/**
* 店铺分类
*/
static async getShopCategories () {
const url = `${this.baseUrl}/shop_parent_categories/0`;
return await this.get(url);
}
/**
* 获取工作台数据
*/
static async info () {
// const params = wx.getStorageSync('mtoken');
const url = `${base.gtBaseUrl()}/orders/orderBusiness/control`;
let data = {
mtoken:wepy.$instance.globalData.siteMtoken,
token: wepy.$instance.globalData.siteToken
};
return await this.post(url,data);
}
/**
* 获取核销员工作台数据
*/
static async infoChecker () {
// let baseUrl = wx.getStorageSync('tag') == 1 ? base.gtBaseUrl() : this.baseUrl;
let baseUrl = base.gtBaseUrl();
const url = `${baseUrl}/orders/api/summary`;
let data = {
mtoken:wepy.$instance.globalData.siteMtoken,
token: wepy.$instance.globalData.siteToken
};
return await this.post(url,data);
}
/**
* 获取店铺信息
*/
static async infoShop () {
const url = `${this.baseUrl}/storemalls/MallInfo/setInfoShow`;
return await this.post(url);
}
static async infoShopNew () {
// const params = wx.getStorageSync('mtoken');
// const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${this.loginUrl}/business/mall/baseInfo`;
return await this.post(url);
}
static async infoShopCity (data) {
// const params = wx.getStorageSync('mtoken');
// const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${base.gtBaseUrl()}/business/Business/detail`;
data.mtoken = wepy.$instance.globalData.siteMtoken;
data.token = wepy.$instance.globalData.siteToken;
return await this.post(url,data);
}
/**
* 店铺推广
*/
static async promoteShop () {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/spreadPicture`;
return await this.post(url);
}
/**
* 更新店铺信息
*/
static async updateShop (shop) {
const url = `${this.baseUrl}/storemalls/MallInfo/setInfo`;
return await this.post(url, shop);
}
/**
* 上传图片
*/
static async image (filePath) {
// const url = `${this.baseUrl}/images`;
const url = `${this.baseUrl}/images`;
const param = {
url,
filePath,
name: 'image'
};
return await wepy.uploadFile(param);
}
/**
* 获取店铺状态
*/
static async getStatus () {
const url = `${this.baseUrlCater1}/Cateringmalls/SettingStoreInfo/queryWork`;
const data = await this.post(url);
// 文本转换
data.statusText = this._processStatusText(data);
data.status = data.status == 'NORMAL';
// 是否全天
data.day = data.beginTime == '00:00' && data.endTime == '23:59';
return data;
}
/**
* 修改店铺状态
*/
static async setStatus (status) {
const url = `${this.baseUrl}/shops/status`;
return this.put(url, status);
}
static _processStatusText (data) {
const status = data.status;
const isOpen = data.open;
if (status == 'NORMAL') {
return isOpen ? '营业中' : '营业中(已打烊)';
} else if (status == 'CLOSE') {
return '歇业中';
}
}
/**
* 配送员列表
*/
static listReduce () {
const url = `${this.baseUrl}/reduce_rule`;
return this.get(url);
}
/**
* 创建
*/
static createReduce (reduce) {
const url = `${this.baseUrl}/reduce_rule`;
return this.post(url, reduce);
}
/**
* 删除
*/
static removeReduce (id) {
const url = `${this.baseUrl}/reduce_rule/${id}`;
return this.delete(url);
}
/**
* 更新
*/
static updateReduce (reduce) {
const url = `${this.baseUrl}/reduce_rule`;
return this.put(url, reduce);
}
/**
* 版本
*/
static _processVersionText(data) {
if (data) {
data.versionText = this.autoVersion[data.chargeVersion];
data.versionConfig = this.autoCofig[data.chargeVersion];
}
return data;
}
}
import base from './base';
import Page from '../utils/Page';
export default class Member extends base {
/**
* 获取会员信息
*/
static async Info (number) {
const url = `${this.baseUrl}/members/number?number=${number}`;
return await this.get(url);
}
/**
* 增加积分信息
*/
static async memberAdd (bonusDetail) {
const url = `${this.baseUrl}/members/bonus_detail`;
return this.post(url, bonusDetail);
}
/**
* 获取买家会员数据
*/
static async customerInfo (customerId) {
const url = `${this.baseUrl}/members?customer_id=${customerId}`;
return await this.get(url);
}
/**
* 获取买家会员卡数据
*/
static async cardInfo () {
const url = `${this.baseUrl}/memberCards`;
return await this.get(url);
}
/**
* 编辑自定义折扣
*/
static customDiscount (member) {
const url = `${this.baseUrl}/members/custom_discount`;
return this.post(url, member);
}
/**
* 历史积分信息
*/
static async bonusPage(customerId) {
const url = `${this.baseUrl}/members/bonus_detail?by=create_time&sort=desc&customer_id=${customerId}`;
return new Page(url, this.processBonusTransformation.bind(this));
}
static processBonusTransformation (bonusInfo) {
const comment = {};
if (bonusInfo.addBonus > 0) {
comment.costMoney = `消费金额:¥ ${bonusInfo.costMoney.toFixed(2)}`;
} else {
comment.costMoney = `抵扣金额:¥ ${bonusInfo.costMoney.toFixed(2)}`;
}
comment.addBonus = bonusInfo.addBonus;
comment.createTime = bonusInfo.createTime;
comment.orderId = bonusInfo.orderId;
comment.typeDesc = bonusInfo.typeDesc;
return comment;
}
/**
* 卖家为用户开通会员卡
*/
static async registe(param) {
const url = `${this.baseUrl}/members`;
return this.post(url, param);
}
}
import base from './base';
import Page from '../utils/Page';
export default class notice extends base {
/**
* 分页方法
*/
static page () {
const url = `${this.baseUrl}/notices`;
return new Page(url);
}
/**
* 创建公告
*/
static async create(notice) {
const url = `${this.baseUrl}/notices`;
return await this.post(url, notice);
}
/**
*获取店铺公告 餐饮版
*/
static async getNotice(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingNoticeset/display`;
return this.post(url, data);
}
/**
*设置店铺公告 餐饮版
*/
static async setNotice(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingNoticeset/addOredit`;
return await this.post(url, data);
}
/**
* 删除公告
*/
static async remove(noticeId) {
const url = `${this.baseUrl}/notices/${noticeId}`;
return await this.delete(url);
}
/**
* 编辑公告
*/
static async update(noticeId, notice) {
const url = `${this.baseUrl}/notices/${noticeId}`;
return await this.put(url, notice);
}
/**
* 单条信息
*/
static async info(noticeId) {
const url = `${this.baseUrl}/notices/${noticeId}`;
return await this.get(url);
}
}
/**
* 订单类型
*/
const TYPE = {
MALL: 10,
TAKEAWAY: 20,
FORHERE: 30,
PACK: 33,
OFFLINE: 40
};
/**
* 支付方式
*/
const PAYMENT = {
OFFLINE: '0',
ONLINE: '1'
};
/**
* 订单状态
*/
const STATUS = {
ALL: 0,
WAITING: 1,
PROCESSING: 2,
SHIPPING: 3,
COMMENTING: 4,
REFUNDING: 5,
SUCCESS: 6,
CLOSED: 7,
REFUND_SUCCESS: 8,
ACCEPTED: 9
};
/**
* 配送方式
*/
const DELIVERY = {
SELF: 'SELF',
CITY: 'CITY',
EXPRESS: 'EXPRESS'
};
/** 数据字典 **/
/**
* 订单类型
*/
const ORDER_TYPE_DICT = {
[TYPE.MALL]: '商城',
[TYPE.TAKEAWAY]: '外卖',
[TYPE.FORHERE]: '堂食',
[TYPE.PACK]: '打包'
};
/**
* 支付方式
*/
const ORDER_PAYMENT_DICT = {
[PAYMENT.OFFLINE]: '线下支付',
[PAYMENT.ONLINE]: '在线支付'
};
/**
* 配送方式
*/
const ORDER_DELIVERY_DICT = {
[DELIVERY.SELF]: '上门自提',
[DELIVERY.CITY]: '同城配送',
[DELIVERY.EXPRESS]: '快递配送'
};
/**
* 默认的订单状态描述
*/
const COMMON_STATUS_DICT = {
[STATUS.ALL]: ['全部', ''],
[STATUS.WAITING]: ['等待买家付款', '请于24小时内付款,超时订单自动关闭'],
[STATUS.PROCESSING]: ['等待卖家发货', '您已完成付款,等待卖家发货,超时未发货将自动退款'],
[STATUS.SHIPPING]: ['卖家已发货', '卖家已发货,请您耐心等待'],
[STATUS.COMMENTING]: ['等待买家评价', '卖家已收到您的货款,请对本次交易进行评价'],
[STATUS.REFUNDING]: ['申请退款中', '您已发起退款申请,等待卖家处理'],
[STATUS.SUCCESS]: ['交易成功', '交易已完成,卖家已收到您的货款'],
[STATUS.CLOSED]: ['交易关闭', '本交易已取消,欢迎您下次光临'],
[STATUS.REFUND_SUCCESS]: ['已退款', '钱款已原路退回,请查收'],
[STATUS.ACCEPTED]: ['已接单', '店家正在备货配送中,请您耐心等待']
};
/**
* 特殊的订单状态描述
*/
const UNIQUE_STATUS_DICT = {
[TYPE.MALL]: {},
[TYPE.TAKEAWAY]: {
[STATUS.PROCESSING]: ['等待店家接单', '您已完成付款,等待店家确认接单,超时未接单将自动退款'],
[STATUS.SHIPPING]: ['店家配送中', '店家配送中,请您耐心等待']
},
[TYPE.FORHERE]: {
[STATUS.PROCESSING]: ['等待店家接单', '您已完成付款,等待店家确认接单,超时未接单将自动退款'],
[STATUS.SHIPPING]: ['店家配餐中', '店家配餐中,请您耐心等待']
},
[TYPE.PACK]: {
[STATUS.PROCESSING]: ['等待店家接单', '您已完成付款,等待店家确认接单,超时未接单将自动退款'],
[STATUS.SHIPPING]: ['店家配餐中', '店家配餐中,请您耐心等待']
}
};
/**
* 按钮的字典
*/
const ACTION = {
CLOSE: {
primary: false,
name: '关闭',
func: 'close'
},
REPRICE: {
primary: false,
name: '改价',
func: 'reprice'
},
TAKE: {
primary: true,
name: '接单',
func: 'take'
},
SEND: {
primary: true,
name: '发货',
func: 'send'
},
RECEIVE: {
primary: true,
name: '送达',
func: 'receive'
},
DEAL_REFUND: {
primary: true,
name: '退款',
func: 'refund'
},
REMARK: {
primary: false,
name: '备注',
func: 'remark'
},
TRACE: {
primary: false,
name: '跟踪',
func: 'trace'
},
PHONE: {
inner: true,
primary: false,
name: '电话',
func: 'phone'
},
PRINT: {
inner: true,
primary: false,
name: '打印',
func: 'print'
}
};
/**
* 状态与按钮的映射关系
*/
const STATUS_ACTIONS = {
// 外卖(线下)
'20-0-2': [ACTION.CLOSE, ACTION.TAKE],
'20-0-9': [ACTION.CLOSE, ACTION.SEND],
'20-0-3': [ACTION.RECEIVE],
'20-0-5': [ACTION.DEAL_REFUND],
// 外卖(线上)
'20-1-1': [ACTION.REPRICE, ACTION.CLOSE],
'20-1-2': [ACTION.CLOSE, ACTION.TAKE],
'20-1-9': [ACTION.CLOSE, ACTION.SEND],
'20-1-3': [ACTION.CLOSE, ACTION.RECEIVE],
'20-1-5': [ACTION.DEAL_REFUND],
// 堂食(线上)
'30-1-1': [ACTION.REPRICE, ACTION.CLOSE],
'30-1-2': [ACTION.CLOSE, ACTION.TAKE],
'30-1-3': [ACTION.CLOSE, ACTION.RECEIVE],
'30-1-5': [ACTION.DEAL_REFUND],
// 外带(线上)
'33-1-1': [ACTION.REPRICE, ACTION.CLOSE],
'33-1-2': [ACTION.CLOSE, ACTION.TAKE],
'33-1-3': [ACTION.CLOSE, ACTION.RECEIVE],
'33-1-5': [ACTION.DEAL_REFUND],
// 商城(线下)
'10-0-2': [ACTION.CLOSE, ACTION.SEND],
'10-0-3': [ACTION.RECEIVE],
'10-0-5': [ACTION.DEAL_REFUND],
// 商城(线上)
'10-1-1': [ACTION.REPRICE, ACTION.CLOSE],
'10-1-2': [ACTION.CLOSE, ACTION.SEND],
'10-1-3': [ACTION.CLOSE, ACTION.RECEIVE],
'10-1-5': [ACTION.DEAL_REFUND],
// 离线支付
'40-1-1': [ACTION.CLOSE]
};
/** 内部方法 **/
const statusDict = (type, status, index) => {
const unique = uniqueStatus(type, status, index);
if (unique != null) {
return unique;
} else {
return commonStatus(status, index);
}
};
const commonStatus = (status, index) => {
const statusDict = COMMON_STATUS_DICT[status];
if (statusDict == null) {
return;
}
return statusDict[index];
};
const uniqueStatus = (type, status, index) => {
const typeDict = UNIQUE_STATUS_DICT[type];
if (typeDict == null) {
return;
}
const statusDict = typeDict[status];
if (statusDict == null) {
return;
}
return statusDict[index];
};
/** 映射方法 **/
/**
* 映射订单类型
*/
const orderType = value => ORDER_TYPE_DICT[value];
/**
* 映射支付类型
*/
const paymentType = value => ORDER_PAYMENT_DICT[value];
/**
* 映射配送类型
*/
const deliveryType = value => ORDER_DELIVERY_DICT[value];
/**
* 映射订单状态
*/
const statusName = (type, status) => statusDict(type, status, 0);
/**
* 映射状态描述
*/
const statusDesc = (type, status) => statusDict(type, status, 1);
/**
* 映射状态动作
*/
const statusActions = (type, payment, status) => {
const key = `${type}-${payment}-${status}`;
const actions = STATUS_ACTIONS[key];
return actions != null ? actions : [];
};
/** 工具方法 **/
/**
* 是否为商城订单
*/
const isMallOrder = type => type == TYPE.MALL;
/**
* 是否为餐饮订单
*/
const isFoodOrder = type => type == TYPE.FORHERE || type == TYPE.PACK || type == TYPE.TAKEAWAY;
/**
* 是否是需要配送的订单
*/
const isDeliveryOrder = type => type == TYPE.TAKEAWAY || type == TYPE.MALL;
/**
* 是否为堂食订单
*/
const isInShopOrder = type => type == TYPE.FORHERE || type == TYPE.PACK;
/**
* 导出的方法
*/
const orderUtils = {
statusActions, orderType, paymentType, deliveryType, statusName, statusDesc, isMallOrder, isFoodOrder, isInShopOrder, isDeliveryOrder
};
export {
ACTION,
TYPE,
PAYMENT,
DELIVERY,
STATUS,
orderUtils
}
// created by gpake
(function() {
var config = {
qiniuRegion: '',
qiniuImageURLPrefix: '',
qiniuUploadToken: '',
qiniuUploadTokenURL: '',
qiniuUploadTokenFunction: null,
qiniuShouldUseQiniuFileName: false
}
module.exports = {
init: init,
upload: upload,
}
// 在整个程序生命周期中,只需要 init 一次即可
// 如果需要变更参数,再调用 init 即可
function init(options) {
config = {
qiniuRegion: '',
qiniuImageURLPrefix: '',
qiniuUploadToken: '',
qiniuUploadTokenURL: '',
qiniuUploadTokenFunction: null,
qiniuShouldUseQiniuFileName: false
};
updateConfigWithOptions(options);
}
function updateConfigWithOptions(options) {
if (options.region) {
config.qiniuRegion = options.region;
} else {
console.error('qiniu uploader need your bucket region');
}
if (options.uptoken) {
config.qiniuUploadToken = options.uptoken;
} else if (options.uptokenURL) {
config.qiniuUploadTokenURL = options.uptokenURL;
} else if(options.uptokenFunc) {
config.qiniuUploadTokenFunction = options.uptokenFunc;
}
if (options.domain) {
config.qiniuImageURLPrefix = options.domain;
}
config.qiniuShouldUseQiniuFileName = options.shouldUseQiniuFileName
}
function upload(filePath, success, fail, options) {
if (null == filePath) {
console.error('qiniu uploader need filePath to upload');
return;
}
if (options) {
updateConfigWithOptions(options);
}
if (config.qiniuUploadToken) {
doUpload(filePath, success, fail, options);
} else if (config.qiniuUploadTokenURL) {
getQiniuToken(function() {
doUpload(filePath, success, fail, options);
});
} else if (config.qiniuUploadTokenFunction) {
config.qiniuUploadToken = config.qiniuUploadTokenFunction();
if (null == config.qiniuUploadToken && config.qiniuUploadToken.length > 0) {
console.error('qiniu UploadTokenFunction result is null, please check the return value');
return
}
} else {
console.error('qiniu uploader need one of [uptoken, uptokenURL, uptokenFunc]');
return;
}
}
function doUpload(filePath, success, fail, options) {
if (null == config.qiniuUploadToken && config.qiniuUploadToken.length > 0) {
console.error('qiniu UploadToken is null, please check the init config or networking');
return
}
var url = uploadURLFromRegionCode(config.qiniuRegion);
(filePath);
var fileName = filePath.split('//')[1];
if (options && options.key) {
fileName = options.key;
}
var formData = {
'token': config.qiniuUploadToken
};
if (!config.qiniuShouldUseQiniuFileName) {
formData['key'] = fileName
}
wx.uploadFile({
url: url,
filePath: filePath,
name: 'file',
formData: formData,
success: function (res) {
var dataString = res.data;
try {
var dataObject = JSON.parse(dataString);
//do something
var imageUrl = config.qiniuImageURLPrefix + '/' + dataObject.truekey;
dataObject.imageURL = imageUrl;
(dataObject);
if (success) {
success(dataObject);
}
} catch(e) {
('parse JSON failed, origin String is: ' + dataString)
if (fail) {
fail(e);
}
}
},
fail: function (error) {
console.error(error);
if (fail) {
fail(error);
}
}
})
}
function getQiniuToken(callback) {
wx.request({
url: config.qiniuUploadTokenURL,
success: function (res) {
var token = res.data.data.uptoken;
if (token && token.length > 0) {
config.qiniuUploadToken = token;
if (callback) {
callback();
}
} else {
console.error('qiniuUploader cannot get your token, please check the uptokenURL or server')
}
},
fail: function (error) {
console.error('qiniu UploadToken is null, please check the init config or networking: ' + error);
}
})
}
function uploadURLFromRegionCode(code) {
var uploadURL = null;
switch(code) {
case 'ECN': uploadURL = 'https://up.qbox.me'; break;
case 'NCN': uploadURL = 'https://up-z1.qbox.me'; break;
case 'SCN': uploadURL = 'https://up-z2.qbox.me'; break;
case 'NA': uploadURL = 'https://up-na0.qbox.me'; break;
default: console.error('please make the region is with one of [ECN, SCN, NCN, NA]');
}
return uploadURL;
}
})();
import base from './base';
import wepy from 'wepy';
export default class shop extends base {
static autoVersion = {
'1': '推广普及版',
'2': '会员普及版',
'3': '会员年费版',
'4': '电商普及版',
'5': '电商年费版',
'6': '全能普及版',
'7': '全能年费版'
};
static autoCofig = {
'1': ['order', 'manusl', 'delivery', 'vip', 'discount', 'add', 'deliveryUser'],
'2': ['order', 'manusl', 'delivery', 'discount'],
'3': ['order', 'manusl', 'delivery', 'discount'],
'4': ['vip', 'add'],
'5': ['vip', 'add'],
'6': [],
'7': []
};
/**
* 获取限制信息
*/
static async limit () {
const url = `${this.baseUrl}/shop_charge_limit`;
const data = await this.get(url);
return this._processVersionText(data);
}
/**
* 获取卖家的店铺列表
*/
static async list (params) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/getList`;
return await this.post(url, params);
}
/**
* 获取卖家的店铺列表
*/
static async list_v2 (params) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/lists/v2`;
return await this.post(url, params);
}
/**
* 获取消息通知列表
*/
static async getMessageList (params) {
// const url = `http://api.xuetang.test.ledianyun.com/lestore/notices/noticeLists`;
const url = `https://xuetang.api.ledianyun.com/lestore/notices/noticeLists`;
return await this.post(url, params);
}
/**
* 获取消息通知详情
*/
static async getMessageDetail (params) {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/messages/official/spliceUrl`;
return await this.post(url, params);
}
/**
* 获取店铺首页数据 餐饮版
*/
static async getShopInfo(data){
const url = `${this.baseUrlCater1}/cateringorders/manage/profile`;
return await this.post(url, data);
}
/**
* 获取店铺信息 餐饮版
*/
static async getShopCaterInfo(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingStoreInfo/display`;
return await this.post(url, data);
}
/**
* 编辑店铺信息 餐饮版
*/
static async setShopCaterInfo(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingStoreInfo/saveOne`;
return await this.post(url, data);
}
/**
* 获取店铺堂食开启状态 餐饮版
*/
static async getShopTangOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingGetFoodNum/enable`;
return await this.post(url, data);
}
/**
* 获取店铺外卖开启状态 餐饮版
*/
static async getShopWaiOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingOutset/querySet`;
return await this.post(url, data);
}
/**
* 设置店铺堂食开启状态 餐饮版
*/
static async setShopTangOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingGetFoodNum/setFoodNum`;
return await this.post(url, data);
}
/**
* 设置店铺外卖开启状态 餐饮版
*/
static async setShopWaiOpen(data){
const url = `${this.baseUrlCater1}/Cateringmalls/SettingOutset/editSet`;
return await this.post(url, data);
}
/**
* 店铺分类
*/
static async getShopCategories () {
const url = `${this.baseUrl}/shop_parent_categories/0`;
return await this.get(url);
}
/**
* 获取工作台数据
*/
static async info () {
// const params = wx.getStorageSync('mtoken');
const url = `${this.baseUrl}/orders/orderBusiness/control`;
return await this.post(url);
}
/**
* 获取核销员工作台数据
*/
static async infoChecker () {
const url = `${this.baseUrl}/orders/api/summary`;
return await this.post(url);
}
/**
* 获取店铺信息
*/
static async infoShop () {
// const params = wx.getStorageSync('mtoken');
// const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${this.baseUrl}/storemalls/MallInfo/setInfoShow`;
return await this.post(url);
}
static async infoShopNew () {
// const params = wx.getStorageSync('mtoken');
// const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${this.loginUrl}/business/mall/baseInfo`;
return await this.post(url);
}
/**
* 店铺推广
*/
static async promoteShop () {
const loginUrl = wepy.$instance.globalData.loginUrl;
const url = `${loginUrl}/business/mall/spreadPicture`;
return await this.post(url);
}
/**
* 更新店铺信息
*/
static async updateShop (shop) {
const url = `${this.baseUrl}/storemalls/MallInfo/setInfo`;
return await this.post(url, shop);
}
//试用版支付接口
static async payMoneyMall (shop) {
const url = `${this.baseUrl}/`;
return await this.post(url, shop);
}
//网店推广
static async spreadOnlineShop(data) {
const url = `${this.gtBaseUrl()}/products/productInfo/storeQrcode?business_id=${data.business_id}&mtoken=${data.mtoken}&mall_name=${data.mall_name}&mall_logo=${data.mall_logo}&token=${data.token}`;
return url;
}
/**
* 上传图片
*/
static async image (filePath) {
// const url = `${this.baseUrl}/images`;
const url = `${this.baseUrl}/images`;
const param = {
url,
filePath,
name: 'image'
};
return await wepy.uploadFile(param);
}
/**
* 获取店铺状态
*/
static async getStatus () {
const url = `${this.baseUrlCater1}/Cateringmalls/SettingStoreInfo/queryWork`;
const data = await this.post(url);
// 文本转换
data.statusText = this._processStatusText(data);
data.status = data.status == 'NORMAL';
// 是否全天
data.day = data.beginTime == '00:00' && data.endTime == '23:59';
return data;
}
/**
* 修改店铺状态
*/
static async setStatus (status) {
const url = `${this.baseUrl}/shops/status`;
return this.put(url, status);
}
static _processStatusText (data) {
const status = data.status;
const isOpen = data.open;
if (status == 'NORMAL') {
return isOpen ? '营业中' : '营业中(已打烊)';
} else if (status == 'CLOSE') {
return '歇业中';
}
}
/**
* 配送员列表
*/
static listReduce () {
const url = `${this.baseUrl}/reduce_rule`;
return this.get(url);
}
/**
* 创建
*/
static createReduce (reduce) {
const url = `${this.baseUrl}/reduce_rule`;
return this.post(url, reduce);
}
/**
* 删除
*/
static removeReduce (id) {
const url = `${this.baseUrl}/reduce_rule/${id}`;
return this.delete(url);
}
/**
* 更新
*/
static updateReduce (reduce) {
const url = `${this.baseUrl}/reduce_rule`;
return this.put(url, reduce);
}
/**
* 版本
*/
static _processVersionText(data) {
if (data) {
data.versionText = this.autoVersion[data.chargeVersion];
data.versionConfig = this.autoCofig[data.chargeVersion];
}
return data;
}
static updatePass(params){
const url = `${this.loginUrl}/business/AccountManage/modifyPassword`;
return this.post(url,params);
}
}
import base from './base';
import wepy from 'wepy';
export default class staff extends base {
/**
** 获取员工列表business/mall/subAccountOperation/enabled
*/
static async getStaffList (params) {
const url = `${this.loginUrl}/business/mall/subAccountLists`;
return await this.post(url, params);
}
/**
** 修改员工状态
*/
static async changeStaffStatus (type,params) {
const url = `${this.loginUrl}/business/mall/subAccountOperation/${type}`;
return await this.post(url, params);
}
/**
** 查询指定店铺信息
*/
static async getMallInfo (params) {
const url = `${this.baseUrl}/storemalls/api/mallInfo`;
return await this.post(url, params);
}
/**
** 查询支付设置信息编辑
*/
static async getOrderTimerSetting (params) {
const url = `${this.baseUrl}/storemalls/mallInfo/orderDueShow`;
return await this.post(url, params);
}
/**
** 设置订单取消时间
*/
static async orderTimerSetting (params) {
const url = `${this.baseUrl}/storemalls/mallInfo/orderDue`;
return await this.post(url, params);
}
/**
** 修改支付后维权时间
*/
static async setAfterActivist (params) {
const url = `${this.baseUrl}/storemalls/mallInfo/afterActivist`;
return await this.post(url, params);
}
/**
** 获取员工详情
*/
static async getStaffDetail (params) {
const url = `${this.loginUrl}/business/mall/subAccountDetails`;
return await this.post(url, params);
}
/**
** 获取角色列表
*/
static async getRoleList (params) {
const url = `${this.loginUrl}/business/mall/subAccountRole`;
return await this.post(url, params);
}
/**
** 验证是不是添加过账号
*/
static async checkBusinessAccount (params) {
const url = `${this.loginUrl}/business/api/checkBusinessAccount`;
return await this.post(url, params);
}
/**
** 编辑员工
*/
static async editStaff (params) {
const url = `${this.loginUrl}/business/mall/subAccountSave`;
return await this.post(url, params);
}
/**
** 发送短信验证码
*/
static async subAccountSmsSend (params) {
const url = `${this.loginUrl}/business/mall/subAccountSmsSend`;
return await this.post(url, params);
}
}
\ No newline at end of file
import base from './base';
export default class vip extends base {
/**
* 会员卡信息
*/
static async info () {
const url = `${this.baseUrl}/memberCards`;
return await this.get(url);
}
/**
* 添加会员卡
*/
static async create (cardParam) {
const url = `${this.baseUrl}/memberCards`;
return this.post(url, cardParam);
}
/**
* 编辑会员卡
*/
static async update (cardParam) {
const url = `${this.baseUrl}/memberCards`;
return this.put(url, cardParam);
}
}
import base from './base';
import Page from '../utils/Page';
export default class visitor extends base {
/**
* 分页方法
*/
static page () {
const url = `${this.baseUrl}/customers/visit_list`;
return new Page(url, this._processShopsVisitor.bind(this));
}
/**
* 创建
*/
static async create (comments) {
const url = `${this.baseUrl}/customers/visit_list`;
return await this.post(url, comments);
}
/**
* 浏览统计
*/
static async count (goodsId) {
const url = `${this.baseUrl}/count/visit_count`;
return await this.get(url);
}
/**
* 处理浏览数列表数据
*/
static _processShopsVisitor (data) {
const visitor = {};
visitor.name = data.nickName;
visitor.key = '访问时间';
visitor.value = data.loginTime.substring(0, 16);
visitor.describe = data.sceneName;
visitor.avatar = data.avatarUrl;
return visitor;
}
}
This diff is collapsed. Click to expand it.
No preview for this file type
!function(s){var e,n='<svg><symbol id="iconv6" viewBox="0 0 1024 1024"><path d="M937.4 146.8 693.7 146.8 360.5 457.4 360.5 146.8 138.6 146.8 138.6 235.6 227.4 235.6 227.4 901.2Z" ></path></symbol></svg>',t=(e=document.getElementsByTagName("script"))[e.length-1].getAttribute("data-injectcss");if(t&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console&&console.log(e)}}!function(e){if(document.addEventListener)if(~["complete","loaded","interactive"].indexOf(document.readyState))setTimeout(e,0);else{var t=function(){document.removeEventListener("DOMContentLoaded",t,!1),e()};document.addEventListener("DOMContentLoaded",t,!1)}else document.attachEvent&&(n=e,o=s.document,i=!1,c=function(){i||(i=!0,n())},(d=function(){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(d,50)}c()})(),o.onreadystatechange=function(){"complete"==o.readyState&&(o.onreadystatechange=null,c())});var n,o,i,c,d}(function(){var e,t;(e=document.createElement("div")).innerHTML=n,n=null,(t=e.getElementsByTagName("svg")[0])&&(t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.width=0,t.style.height=0,t.style.overflow="hidden",function(e,t){t.firstChild?function(e,t){t.parentNode.insertBefore(e,t)}(e,t.firstChild):t.appendChild(e)}(t,document.body))})}(window);
\ No newline at end of file
@font-face {font-family: "iconfont";
src: url('./iconfont.eot?t=1553510217392'); /* IE9 */
src: url('./iconfont.eot?t=1553510217392#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAJ8AAsAAAAABhgAAAIwAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAooSQE2AiQDCAsGAAQgBYRtBywbawURBeTJfhyUm84ERQpGGQfs/uuHVNx3PDzt9+3cN/N3Z8WQJprgJ0wkmScRS9YIVUMkJI2kjYjo0dwQ/ZIuJNTT1rE0h/uJ3w6riZQIkRAJGT3Zdghs9iREqQhdaJXPczm9CXQg8wOd62oOGmPjpF5AvTigQPfAKLIySbxh7IIX+JhAs37qYqaycKUis1cFYo+/faNSSMgyKxehoeFgFtdKdaW6UnmAq9H347XhUajUEnvj0m2ztpj6zDPp9P80LSBKyZIAj9eQUEcmVjYWFkuCcUnz6WwQsix45v9/7BdH9Qj219mtraAPLAbPeCsFqOCxgsrgnujHohwT16rQksff+H1eOGrSvW7tTTvw/1e6VXknEKy795PWd6y+lpYMnt5/Mg/E/v/KhoUoK/rDD1AHDmVDt31V1tTG8UrZcUezZvyHIz10T3X2PlslFL0nhBr1zZAUQ8jM1lHTYiQaFFPQbJg5x1v0tFcSuQlDXQAIC70B5SHoQyr7hWk/OEYV4aLnhWnCFzMIbcYrOC/wL2ki3QCLuH2P7i2yKa9H/Bmp8NPQ7/TKZRUTpCW2FHd3wCxBUhqDAp7DKEohozTAC3c85mzR7cqmN3UuaVwSFkE2hq6A4wX4LlIJGUxmovL5PeS6idioY6CuPEOk4M8O+jp6A0jVmgwaeJRXCneuAcYkIJFUDChgHopEUiBrnhdAF6zDm5DLLHSdUXKotbO9Pf67U9DMdlXh1Cc4OCmVAAAA') format('woff2'),
url('./iconfont.woff?t=1553510217392') format('woff'),
url('./iconfont.ttf?t=1553510217392') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('./iconfont.svg?t=1553510217392#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 26rpx;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="v6" unicode="&#58880;" d="M937.4 749.2L693.7 749.2 360.5 438.6 360.5 749.2 138.6 749.2 138.6 660.4 227.4 660.4 227.4-5.2000000000000455Z" horiz-adv-x="1024" />
</font>
</defs></svg>
No preview for this file type
No preview for this file type
<template>
<view class="action-bar-placeholder"></view>
<view class="action-bar row-center fixed-bottom" wx:if="{{noCancel == 0}}">
<form report-submit="true" @submit="back" style="width: 50%;height: 100%">
<button class="action secondary-action row-center" formType="submit" style="border-radius: 0px">
<text>{{cancelText}}</text>
</button>
</form>
<form report-submit="true" @submit="tap" style="width: 50%;height: 100%">
<button class="action {{okType}}-acton row-center" formType="submit" style="border-radius: 0px">
<text>{{okText}}</text>
</button>
</form>
</view>
<view class="action-bar row-center fixed-bottom" wx:else>
<view class="action {{okType}}-acton row-center" style="width: 100%" @tap="tap">
<text>{{okText}}</text>
</view>
</view>
</template>
<script>
import wepy from 'wepy'
import Open from '../../api/auth'
export default class ActionBar extends wepy.component {
props = {
address: {},
okType: {
default: 'primary'
},
okText: {
default: '确定'
},
cancelText: {
default: '取消'
},
noCancel: {
default: 0
}
};
methods = {
tap(e) {
let openid = wx.getStorageSync('openid'),formid = e.detail.formId;
let mtoken = wx.getStorageSync('mtoken');
Open.sendFormid({
btoken: 'LESTORE_BUSINESS_LITE',
mtoken: 'LESTORE_BUSINESS_LITE',
utoken: mtoken,
form_id: formid,
openid: openid
}).then(res => {})
this.$emit('tap');
},
back(e) {
if(this.cancelText == '我要选货'){
this.$emit('choose');
console.log('choose')
return;
};
let openid = wx.getStorageSync('openid'),formid = e.detail.formId;
let mtoken = wx.getStorageSync('mtoken');
Open.sendFormid({
btoken: 'LESTORE_BUSINESS_LITE',
mtoken: 'LESTORE_BUSINESS_LITE',
utoken: mtoken,
form_id: formid,
openid: openid
}).then(res => {})
wepy.navigateBack();
}
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.action-bar-placeholder{
height: 120rpx;
width: 100%;
background-color: $color-bg-body;
}
.action-bar{
width: 100%;
height: 100rpx;
z-index: 100;
.action{
height: 100%;
width: 100%;
text{font-size: $text-xl;}
}
.primary-acton{
background-color: $color-primary;
text{color: #FFF;}
}
.danger-acton{
background-color: $color-danger;
text{color: #FFF;}
}
.secondary-action{
background-color: #FFF;
border-top: $border;
}
}
</style>
<template>
<view class="main-container">
<view class="zan-panel">
<view class="zan-btns">
<button class="zan-btn zan-btn--fill" form-type="submit">{{submitText}}</button>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
export default class ActionPanel extends wepy.component {
props = {
mode: {},
submitText: {
default: '保存'
}
};
methods = {
submit () {
this.$emit('submit');
},
remove () {
this.$emit('remove');
}
};
}
</script>
<style lang="scss">
@import "../../styles/variable";
.main-container{
background-color: white;
min-height: 100rpx;
width: 100%;
}
</style>
<template>
<view class="address-box row" wx:if="{{address.fullAddress}}">
<!--左侧图标-->
<view class="icon-box">
<image class="icon-lg" src="/images/icons/address.png"/>
</view>
<!-- 地址内容 -->
<view class="info-box column">
<view class="row-between">
<text>收货人:{{address.name}} </text>
<view class="row" @tap="phone">
<image class="icon" src="/images/icons/call.png" />
<text class="primary ml10">{{address.phone}}</text>
</view>
</view>
<view class="mt10">
<text>地址:{{address.fullAddress}} </text>
</view>
</view>
</view>
<image class="hr-address" src="/images/icons/address-hr.png" />
</template>
<script>
import wepy from 'wepy'
export default class Address extends wepy.component {
props = {
address: {}
};
methods = {
phone() {
wepy.makePhoneCall({phoneNumber: this.address.phone});
}
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.address-box{
padding: 25rpx 20rpx 25rpx 0;
background-color: #FFF;
.icon-box{
width: 80rpx;
text-align: center;
}
.info-box{
width: 600rpx;
flex:1;
text{ font-size: $text-lg}
}
}
.hr-address{
width: 100%;
height: 5px;
margin-bottom: 15rpx;
}
</style>
<template>
<view class="info-box column-center">
<image class="avatar" src="{{info.mall_logo}}" />
<text class="name">{{info.name}}</text>
</view>
</template>
<script>
import wepy from 'wepy';
export default class AvatarPanel extends wepy.component {
props = {
info: {}
};
}
</script>
<style lang="scss">
@import "../../styles/variable";
.info-box{
align-items: center;
height: 300rpx;
background-color: $color-primary;
.avatar{
height:160rpx;
width: 160rpx;
border-radius: 50%;
}
.name{
color: white;
font-size: $text-xxl;
margin-top: 20rpx;
}
}
</style>
<template>
<view class="info-box column-center">
<image class="avatar" src="{{info.logo}}" />
<text class="name">{{info.name}}</text>
</view>
</template>
<script>
import wepy from 'wepy';
export default class AvatarPanel extends wepy.component {
props = {
info: {}
};
}
</script>
<style lang="scss">
@import "../../styles/variable";
.info-box{
align-items: center;
height: 300rpx;
background-color: $color-primary;
.avatar{
height:160rpx;
width: 160rpx;
border-radius: 50%;
}
.name{
color: white;
font-size: $text-xxl;
margin-top: 20rpx;
}
}
</style>
<template>
<navigator target="miniProgram" open-type="navigate" app-id="wxf8f052d10f5d09bf" path="" class="weui-footer {{buttom == 'true' ? 'weui-footer_fixed-bottom' : 'mt20'}} ">
<view class="weui-footer__links">
<image src="http://static.ledouya.com/FilnVxy0czZgxsEHEt8E7_4M2bAB" style="width: 160rpx;height: 40rpx;"></image>
</view>
<view class="weui-footer__text" style="color:#999;margin-left: 15rpx">乐店云技术支持</view>
</navigator>
</template>
<script>
import wepy from 'wepy'
export default class Copyright extends wepy.component {
props ={
buttom: {
default: 'false'
}
};
data = {
version: null
};
onLoad () {
this.version = wepy.$instance.globalData.version;
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
</style>
<template>
<block wx:if="{{show}}">
<!--空占位符-->
<view class="empty-placeholder row-center" wx:if="{{type == 'empty'}}" @tap="tap" >
<image class="icon-xl" src="/images/icons/empty.png"/>
<text class="ml20">{{message}}</text>
</view>
<!--新增占位符-->
<view class="empty-placeholder column-center" wx:if="{{type == 'add'}}" @tap="tap">
<image class="icon-xl" src="/images/icons/plus.png"/>
<text class="mt20">{{message}}</text>
</view>
</block>
</template>
<script>
import wepy from 'wepy'
export default class Placeholder extends wepy.component {
props = {
show: {
type: Boolean,
default: false
},
type: {
type: String,
default: 'empty'
},
message: {default: '没有相关信息'}
};
methods = {
tap() {
this.$emit('tap');
}
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.empty-placeholder{
position: fixed;
top: 300rpx;
width: 100%;
height: 300rpx;
align-items: center;
text{
color: $color-weak;
font-size: 40rpx;
}
}
</style>
<template>
<!--遮罩层-->
<view class="slider-panel-cover" wx:if="{{display == 'true'}}" @tap="close"></view>
<!--滑动面板-->
<view class="slider-panel-box {{display == 'true' ? 'slider-panel-show' : '' }} " style="min-height: {{minHeight}}">
<!--面板标题-->
<view class="header-box">
<!--提示按钮-->
<view class="tips-box" @tap="tipBtn">
提示
</view>
<!--标题槽位-->
<view class="title-box">
<slot name="title"></slot>
</view>
<!--关闭按钮-->
<view class="close-box">
<image class="icon" @tap="close" src="/images/icons/close.png" />
</view>
</view>
<!--内容槽位-->
<scroll-view scroll-y="true" class="content-box" style="background-color:{{backgroundColor}};">
<slot name="content"></slot>
</scroll-view>
<!-- 按钮区域 -->
<view class="btn-box row-center" wx:if="{{btn == 'true'}}">
<view class="btn-back column-center" @tap="close"><text>取消</text></view>
<view class="btn-primary column-center ml20"><text>确定</text></view>
</view>
</view>
</template>
<script>
import wepy from 'wepy'
import Tips from '../../utils/Tips';
export default class SliderPanel extends wepy.component {
props = {
display: {
default: 'true',
twoWay: true
},
backgroundColor: {
default: '#F8F8F8'
},
minHeight: {
default: '200px'
},
btn: {
default: 'false'
}
};
data = {
};
methods = {
close() {
this.display = 'false';
},
tipBtn(){
wx.showModal({
title: "提示",
content: "若分类为空,请前往我的-->分类管理进行新增配置",
showCancel: true,
success: res => {
if (res.confirm) {
this.display = 'false';
wx.switchTab({
url: '/pages/shop/index'
})
} else if (res.cancel) {
}
},
fail: res => {
}
})
}
};
events = {};
onLoad() {
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.slider-panel-cover{
width: 100%;
height: 100%;
position: fixed;
top: 0;
background-color: black;
-webkit-filter:opacity(.6);
z-index: 100000;
}
.slider-panel-box{
position: fixed;
display: flex;
flex-direction: column;
bottom: 0;
width: 100%;
z-index: 100000;
background-color:#F8F8F8;
transform: translateY(150%);
transition: all 0.4s ease;
padding-bottom: 20rpx;
overflow-y: scroll;
.header-box{
text-align: center;
padding: 30rpx 0 10rpx 0;
.tips-box{
position: absolute;
left: 20rpx;
top:20rpx;
font-size: $text-lg;
color: $color-primary;
padding:0rpx 10rpx;
border:2rpx solid $color-primary;
}
.title-box view{
font-size: $text-lg;
color: $color-muted;
}
.close-box{
width: 100rpx;
position: absolute;
right: 10rpx;
top:30rpx;
}
}
.content-box{
max-height:750rpx;
}
}
// 按钮组
.btn-box{
padding-top: 20rpx;
view {
background-color: white;
border-style: solid;
border-width: 1px;
border-radius: 5px;
width:250rpx;
height: 70rpx;
text {
font-size: $text-xl;
}
}
.btn-primary{
border-color: $color-primary;
text {
color: $color-primary;
}
}
.btn-back{
border-color: $color-muted;
text {
color: $color-muted;
}
}
}
.slider-panel-show{
transform: translateY(0);
}
</style>
<template>
<!-- 分类 -->
<SliderPanel :display.sync="display" btn='false' :minHeight.sync="minHeight">
<view slot="title">{{title}}</view>
<view slot="content" class="weui-cells-form">
<radio-group @change="change" @tap="tap">
<label class="weui-cell weui-check__label" wx:if="{{displatyDefault == 'true' }}">
<radio class="weui-check" value="{{''}}" checked="{{selectedId == null || selectedId == ''}}"/>
<view class="weui-cell__bd">全部</view>
<view class="weui-cell__ft weui-cell__ft_in-radio" wx:if="{{selectedId == null || selectedId == ''}}">
<icon class="weui-icon-radio" type="success_no_circle" size="16"></icon>
</view>
</label>
<label class="weui-cell weui-check__label" wx:for="{{list}}" wx:key="value">
<radio class="weui-check" value="{{item.id}}" checked="{{selectedId == item.id}}"/>
<view class="weui-cell__bd">{{item.name}}</view>
<view class="weui-cell__ft weui-cell__ft_in-radio" wx:if="{{selectedId == item.id}}">
<icon class="weui-icon-radio" type="success_no_circle" size="16"></icon>
</view>
</label>
</radio-group>
<!-- 可扩展功能区域 -->
<slot name="extend"></slot>
</view>
</SliderPanel>
</template>
<script>
import wepy from 'wepy';
import SliderPanel from './slider_panel';
export default class SliderSelector extends wepy.component {
props = {
display: {
default: 'true',
twoWay: true
},
minHeight: {
default: '300rpx'
},
title: {
type: String,
default: '请选择'
},
displatyDefault: {
type: String,
default: 'false'
},
list: {}
};
data = {
selectedId: '',
selectedName: ''
};
methods = {
change(e) {
const selectedId = e.detail.value;
const selectedName = selectedId == '' ? '全部' : this.list.find(item => item.id == selectedId).name;
this.selectedId = selectedId;
this.selectedName = selectedName;
this.$emit('change', {selectedId, selectedName})
},
tap() {
this.display = 'false';
}
};
components = {
SliderPanel: SliderPanel
}
events = {};
onLoad() {
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
</style>
<template>
<view class="container">
<view class="active-item" wx:for="{{activeList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="base-info">
<view class="name-time">
<view class="item-name">{{item.name}}</view>
<view class="active-time">
<view class="item-time-1">活动时间:</view>
<view>
<view style="color: #4A4A4A;font-size: 24rpx">始:{{item.begin_time}}</view>
<view style="color: #4A4A4A;font-size: 24rpx">止:{{item.end_time}}</view>
</view>
</view>
<view class="item-time-2">提货时间:<span style="color: #4A4A4A">{{item.put_goods}}</span></view>
</view>
<image class="status-image" src="http://static.ledouya.com/Fq_acf5ahkyRH3LXhrCtjbSnMoTG" wx:if="{{item.status == 0}}"></image>
<image class="status-image" src="http://static.ledouya.com/FsYVydyv_9RRSGyfRD5lOLmDCQRk" wx:if="{{item.status == 1}}"></image>
<image class="status-image" src="http://static.ledouya.com/FkdlWEuP62BtgKs88xkF7TbUgc-Z" wx:if="{{item.status == 2}}"></image>
<view class="delete" @tap="deleteActive({{item.id}})">
<image src="http://static.ledouya.com/FohANlRAhULKB7yxkEnryFn4Dy9Y"></image>
</view>
</view>
<view class="operation-bar">
<div class="operation-item" @tap="goProductList({{item.activity_product}},{{item.id}})">商品</div>
<div class="operation-item" @tap="goOrders({{item.begin_time}},{{item.end_time}},{{item.id}},{{item.status}})">发货单</div>
<div class="operation-item" @tap="goData({{item.id}})">数据</div>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
import community from '../../api/community';
import Tips from '../../utils/Tips';
import Events from '../../utils/Event'
export default class CouponItem extends wepy.component {
props = ['activeList'];
data = {};
methods = {
//删除活动
deleteActive(id) {
wx.showModal({
title: '温馨提示',
content: '删除后无法恢复,确认删除?',
success(resp) {
if(resp.confirm) {
community.deleteActive({activity_id: id}).then(res => {
if(res.error == 0) {
Tips.success('删除成功!');
Events.emit(Events.DELETE_ACTIVE)
}
})
}
}
})
},
goProductList(list,id) {
// let productList = [];
// productList = list;
// let StringList = JSON.stringify(productList)
wx.navigateTo({
url: '../../pages/coupon/productList?active_id=' + id
})
},
goOrders(start,end,id,status) {
let start1 = start.substring(0, 10);
let end1 = end.substring(0,10);
wx.navigateTo({
url: '../../pages/coupon/orderList?start_time=' + start1 + '&end_time=' + end1 + '&activity_id=' + id + '$status=' + status
})
},
goData(id) {
wx.navigateTo({
url: '../../pages/coupon/dataCenter?id=' + id
})
}
};
onLoad(){
}
}
</script>
<style scoped>
.active-item {
margin-top: 20rpx;
background: #fff;
padding: 40rpx 24rpx 20rpx 24rpx;
}
.base-info {
display: flex;
align-items: center;
justify-content: space-between;
}
.name-time {
display: flex;
flex-direction: column;
justify-content: space-between;
width: 500rpx;
height: 200rpx;
}
.status-image {
width: 118rpx;
height: 118rpx;
}
.delete {
width: 60rpx;
height: 200rpx;
text-align: right;
}
.delete image{
width: 29rpx;
height: 29rpx;
}
.item-name {
font-size: 32rpx;
color: #000;
}
.item-time-1 {
color: #9B9B9B;
font-size: 26rpx;
}
.active-time {
display: flex;
align-items: center;
}
.item-time-2 {
font-size: 26rpx;
color: #9B9B9B;
}
.operation-bar {
margin-top: 40rpx;
border-top: 1rpx #e8e8e8 solid;
padding-top: 20rpx;
display: flex;
justify-content: flex-end;
}
.operation-item {
width: 149rpx;
height: 54rpx;
line-height: 54rpx;
border-radius: 27rpx;
border: 1rpx #D8D8D8 solid;
text-align: center;
margin-left: 37rpx;
color: #666;
}
</style>
\ No newline at end of file
<template>
<view class="coupon-box row-center {{coupon.status == 'USED' ? 'coupon-item-disable' : '' }}">
<!--左侧区域-->
<view class="main-box column-center" wx:if="{{coupon.type == 'CASH'}}">
<view>
<text class="xl">¥</text>
<text class="price">{{coupon.price}}</text>
</view>
<text class="mt10" wx:if="{{coupon.limitPrice == 0}}">无门槛</text>
<text class="mt10" wx:else>满{{coupon.limitPrice}}元可用</text>
</view>
<view class="main-box column-center" wx:if="{{coupon.type == 'EXCHANGE'}}">
<text class="exchange">兑换券</text>
<text class="mt10" wx:if="{{coupon.limitPrice == 0}}">无门槛</text>
<text class="mt10" wx:else>满{{coupon.limitPrice}}元可用</text>
</view>
<!--右侧区域-->
<view class="info-box column">
<view class="column">
<text class="lg">{{coupon.name}}</text>
<text class="muted xs mt10">满{{coupon.limitPrice}}元减{{coupon.price}}元</text>
</view>
<!--分隔符-->
<view class="btn-box">
<text class="muted xs">有效期:{{coupon.beginTime}}-{{coupon.dueTime}}</text>
</view>
</view>
<image class="coupon-used-icon" wx:if="{{coupon.status == 'USED'}}" src="/images/icons/coupon_check.png" />
</view>
</template>
<script>
import wepy from 'wepy';
export default class CouponItem extends wepy.component {
props = {
coupon: {}
};
data = {};
onLoad() {
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
/*父容器*/
.coupon-box{
position: relative;
margin:20rpx 20rpx 0 20rpx;
background-color: #FFF;
height: 220rpx;
border: $border;
border-radius: 5px;
overflow: hidden;
.main-box{
align-items: center;
width: 255rpx;
height: 100%;
background: linear-gradient(to right, #2F80ED, #1296db);
text{color: white}
text.price{
font-size: 75rpx;
}
}
.info-box{
flex: 1;
justify-content: space-between;
padding: 10rpx 20rpx 0 20rpx;
height: 200rpx;
.btn-box{
padding: 5px 0;
margin-top: 5rpx;
border-top: $border-dot;
}
}
}
/*已使用/已过期情况调整*/
.coupon-item-disable{
overflow: hidden;
}
.coupon-item-disable .main-box{
background: #C2C2C2;
}
.coupon-item-disable .main-box text{
color: #FFF;
}
.coupon-item-disable .info-box text{
color: #A7A7A7;
}
.coupon-used-icon{
height: 64px;
width: 64px;
position: absolute;
top: 2px;
right: -8px;
}
</style>
<template>
<view class="coupon-box row-center ">
<!--左侧区域-->
<view class="{{shixiao != '3' ? 'main-box' : 'main-box-item'}} column-center" wx:if="{{coupon.type == 1}}">
<view wx:if="{{coupon.coupon_discount_way.is_type == 1}}">
<text class="xl">免减</text>
<text class="price">{{coupon.coupon_discount_way.money / 100}}</text>
</view>
<view wx:if="{{coupon.coupon_discount_way.is_type == 2}}">
<text class="xl">折扣</text>
<text class="price">{{coupon.coupon_discount_way.money}}</text>
</view>
<text class="mt10" wx:if="{{coupon.coupon_limit_use.is_type == 1}}">全品直减</text>
<text class="mt10" wx:if="{{coupon.coupon_limit_use.is_type == 2}}">满{{coupon.coupon_limit_use.money / 100}}元可用</text>
</view>
<view class="main-box column-center" wx:if="{{coupon.type == 2}}">
<view wx:if="{{coupon.active_rule.is_type == 1}}">
<text class="xl">立减</text>
<text class="price">{{coupon.active_rule.money / 100}}</text>
</view>
<view wx:if="{{coupon.active_rule.is_type == 2}}">
<text class="xl">包邮</text>
<!--<text class="price">{{coupon.coupon_discount_way.money}}</text>-->
</view>
<view wx:if="{{coupon.active_rule.is_type == 3}}">
<text class="xl">折扣</text>
<text class="price">{{coupon.active_rule.money}}</text>
</view>
<text class="mt10">满{{coupon.active_rule.full_money / 100}}元可用</text>
</view>
<!--右侧区域-->
<view class="info-box column">
<view>
<view class="row">
<view class="small label primary" wx:if="{{coupon.type == 1}}">优惠券</view>
<view class="small label primary" wx:if="{{coupon.type == 2}}">满减券</view>
<text class="sm" wx:if="{{coupon.type == 1}}">{{coupon.coupon_name}}</text>
<text class="sm" wx:if="{{coupon.type == 2}}">{{coupon.active_name}}</text>
</view>
<text class="muted xs">{{coupon.start_time}}-{{coupon.end_time}}</text>
</view>
<!--分隔符-->
<view class="btn-box row-between">
<view>
<text class="muted mr20 sm">已领取: {{coupon.receive_num}}</text>
<text class="muted sm">已核销: {{coupon.use_num}}</text>
</view>
<view>
<image class="icon" src="/images/icons/more-gray.png" ></image>
</view>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
export default class CouponItem extends wepy.component {
props = {
coupon: {},
action: {
default: 'true'
},
shixiao: {
}
};
data = {};
methods = {
edit(couponId) {
const param = {
couponId,
mode: 'edit'
};
this.$root.$navigate('edit', param);
},
pick(couponId) {
const param = {
couponId,
mode: 'pick_list'
};
this.$root.$navigate('pick_list', param);
}
};
}
</script>
<style lang="scss">
@import "../../styles/variable";
/*父容器*/
.coupon-box{
position: relative;
margin:20rpx 20rpx 0 20rpx;
background-color: #FFF;
height: 220rpx;
border: $border;
border-radius: 5px;
overflow: hidden;
.main-box{
align-items: center;
width: 255rpx;
height: 100%;
background: linear-gradient(to right, #2F80ED, #1296db);
text{color: white}
text.price{
font-size: 75rpx;
}
text.exchange{
font-size: 55rpx;
}
}
.main-box-item {
align-items: center;
width: 255rpx;
height: 100%;
background: #999999;
text{color: white}
text.price{
font-size: 75rpx;
}
text.exchange{
font-size: 55rpx;
}
}
.info-box{
flex: 1;
justify-content: space-between;
padding: 10rpx 20rpx 0 20rpx;
height: 200rpx;
.btn-box{
padding: 5px 0;
margin-top: 5rpx;
border-top: $border-dot;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="container">
<view class="record-list" wx:for="{{recordList}}" wx:for-index="index" wx:for-item="item" wx:key="index" @tap="recordDetail">
<view class="record-time">{{item.created_at}}</view>
<view class="record-content">{{item.live_word}}</view>
<view class="record-picture">
<image wx:for="{{item.live_data}}" wx:for-index="index1" wx:for-item="item1" wx:key="index1" src="{{item1.pic}}"></image>
</view>
<view class="zan-comment">
<view class="browse">浏览:{{item.browse_num}}</view>
<view class="record-num">
<view class="comment">
<image src="http://static.ledouya.com/FkYCtJFxoEjRWN9JDColnVLyK7lm"></image>
<view>{{item.comment_num}}</view>
</view>
<view class="zan">
<image src="http://static.ledouya.com/FuPJWgGkX_EArWAegg-WXfrKUnxH"></image>
<view>{{item.praise_num}}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
export default class liveRecordItem extends wepy.component {
props = ['recordList'];
data = {};
methods = {
recordDetail() {
wx.navigateTo({
url: 'recordDetail'
})
}
};
}
</script>
<style scoped>
.record-list {
padding: 30rpx 0;
margin: 0 auto;
width: 702rpx;
border-bottom: 1rpx #F2F2F2 solid;
}
.record-time {
width: 100%;
box-sizing: border-box;
text-align: right;
font-size: 24rpx;
color: #9B9B9B;
}
.record-content {
font-size: 30rpx;
color: #000;
}
.record-picture {
display: flex;
/*justify-content: space-between;*/
flex-wrap: wrap;
margin-top: 20rpx;
}
.record-picture image {
width: 229rpx;
height: 229rpx;
margin-right: 5rpx;
margin-top: 5rpx;
}
.zan-comment {
display: flex;
justify-content: space-between;
margin-top: 25rpx;
}
.browse {
color: #9A9A9C;
font-size: 24rpx;
}
.record-num {
width: 480rpx;
display: flex;
justify-content: flex-end;
padding-right: 17rpx;
color: #999999;
}
.record-num image {
width: 24rpx;
height: 24rpx;
margin-right: 5rpx;
}
.comment {
display: flex;
margin-right: 52rpx;
align-items: center
}
.comment view {
font-size: 24rpx;
color: #999999;
}
.zan {
display: flex;
align-items: center
}
.zan view {
font-size: 24rpx;
color: #999999;
margin-top: 2rpx;
}
</style>
\ No newline at end of file
<style type="scss">
.chartboard {
padding-bottom: 120rpx;
&.fixed {
position:fixed;
left:0;
right:0;
overflow-y:scroll;
}
.msgarea {
padding: 20rpx 10rpx;
.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}
.clearfix{height:1%;}
.msg {
border: 1px solid #d8d8d8;
font-size: 32rpx;
display: inline-block;
padding: 14rpx 20rpx;
max-width: 450rpx;
border-radius: 15rpx;
}
.icon {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
&.fromme {
.msg {
background-color: #9fe757;
float: right;
margin-right: 10rpx;
}
.icon {
float: right;
margin-right: 10rpx;
}
}
&.other {
.msg {
background-color: #fff;
float: left;
margin-left: 10rpx;
}
.icon {
float: left;
margin-left: 10rpx;
}
}
.right {
width: 200rpx;
float: right;
margin-right: 15rpx;
}
.left {
width: 200rpx;
float: left;
margin-left: 15rpx;
}
}
}
</style>
<template>
<scroll-view scroll-y="1" style="height:1100rpx;" scroll-top="{{(chatHistory.length-1)*260}}" class="chartboard">
<block wx:for="{{chatHistory}}" wx:key="index" wx:for-index="index" wx:for-item="item">
<view class="msgarea{{item.to_user !== mtoken ? ' fromme' : ' other'}}">
<image class="icon" src="{{item.to_user !== mtoken ? shopImgeUrl : avatarUrl}}"></image>
<view class="msg" wx:if="{{item.type == 'text'}}">{{item.content}}</view>
<image wx:else src="{{item.content}}" mode="widthFix" class="{{item.to_user !== mtoken ? 'right' : 'left'}}" @tap="previewReply({{item.content}})"></image>
<view class="clearfix"></view>
</view>
</block>
</scroll-view>
</template>
<script>
import wepy from 'wepy';
import shop from '../../api/shop';
export default class Chartboard extends wepy.component {
props = {
chatHistory: {},
avatarUrl: {}
};
data = {
shopImgeUrl: '',
mtoken: ''
};
onLoad() {
this.mtoken = wx.getStorageSync('mtoken');
shop.infoShop().then(res => {
this.shopImgeUrl = res.data.mall_logo;
this.$apply();
});
}
methods= {
previewReply(imageUrl) {
wx.previewImage({
current: imageUrl,
urls: [imageUrl]
})
},
};
fixPosition(focus) {
this.focus = focus;
this.$apply();
}
}
</script>
<template>
<view class="coupon-box row-center " @longtap="remove({{coupon.id}})">
<!--左侧区域-->
<view class="main-box column-center" wx:if="{{coupon.type == 'CASH'}}">
<view>
<text class="xl">¥</text>
<text class="price">{{coupon.price}}</text>
</view>
<text class="mt10" wx:if="{{coupon.limitPrice == 0}}">无门槛</text>
<text class="mt10" wx:else>满{{coupon.limitPrice}}元可用</text>
</view>
<view class="main-box column-center" wx:if="{{coupon.type == 'EXCHANGE'}}">
<text class="exchange">兑换券</text>
<text class="mt10" wx:if="{{coupon.limitPrice == 0}}">无门槛</text>
<text class="mt10" wx:else>满{{coupon.limitPrice}}元可用</text>
</view>
<!--右侧区域-->
<view class="info-box column">
<view>
<view>
<view class="small label primary" wx:if="{{coupon.supportType == 0}}">通用</view>
<view class="small label primary" wx:if="{{coupon.supportType == 1}}">线上</view>
<view class="small label primary" wx:if="{{coupon.supportType == 2}}">线下</view>
<text class="sm">{{coupon.name}}</text>
</view>
<text class="muted xs">{{coupon.beginTime}}-{{coupon.dueTime}}</text>
</view>
<view class="btn-box row-end">
<block wx:if="{{selectAction != '0'}}">
<view class="zan-btn zan-btn--small zan-btn--primary" @tap="sendCoupon">{{couponText}}</view>
</block>
<block wx:else>
<text class="muted xs">领取时间:{{coupon.acceptTime}}</text>
<text class="muted xs" style="margin-left: 20rpx">状态:{{coupon.status}}</text>
</block>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
import Tips from '../../utils/Tips';
export default class CouponItem extends wepy.component {
props = {
coupon: {},
action: {
default: true
},
selectAction: {
default: true
},
couponText: {
default: '发放'
}
};
data = {};
methods = {
async sendCoupon() {
await Tips.confirm('确认选择该优惠券吗?');
// 发射事件
this.$emit('select', this.coupon);
}
};
onLoad() {
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
/*父容器*/
.coupon-box {
position: relative;
margin: rpx(20) rpx(20) 0 rpx(20);
background-color: #FFF;
height: rpx(220);
border: $border;
border-radius: 5px;
overflow: hidden;
.main-box {
align-items: center;
width: rpx(255);
height: 100%;
background: linear-gradient(to right, #2F80ED, #1296db);
text {
color: white
}
text.price {
font-size: rpx(75);
}
text.exchange {
font-size: 55rpx;
}
}
.info-box {
flex: 1;
justify-content: space-between;
padding: rpx(10) rpx(20) 0 rpx(20);
height: rpx(200);
.img-select {
position: relative;
top: rpx(-15);
left: rpx(350);
image {
@include icon-image(rpx(50));
}
}
.btn-box {
padding: 5px 0;
margin-top: rpx(5);
border-top: $border-dot;
}
}
}
</style>
<style type="scss">
$fontcolor: #7b7b7b;
$activecolor: #13b113;
.input {
color: $fontcolor;
position: fixed;
bottom: 0;
height: 100rpx;
width: 100%;
border-top: 1px solid #d8d8d8;
background-color: #fff;
font-size: 22rpx;
.input_layout {
position: relative;
.input_icon {
position: absolute;
width: 70rpx;
height: 70rpx;
top: 10rpx;
&.voice {
left: 20rpx;
}
&.face {
right: 120rpx;
}
&.plus {
right: 20rpx;
}
}
.input_text {
border-bottom: 1px solid #d8d8d8;
margin-left: 120rpx;
margin-right: 120rpx;
height: 80rpx;
font-size: 32rpx;
color: #000;
&.focus {
border-bottom: 1px solid #9bb793;
}
}
.send {
background-color: #14b012;
display: inline-block;
box-sizing: border-box;
position: absolute;
border: 1px solid #378c37;
border-radius: 5rpx;
right:20rpx;
width:90rpx;
height: 74rpx;
line-height: 72rpx;
color: white;
text-align: center;
font-size: 30rpx;
margin-top:8rpx;
&.hidden {
display: none;
}
}
}
}
</style>
<template>
<view class="input">
<view class="input_layout">
<image class="input_icon voice" src='http://static.ledouya.com/FtA0BaWGjvMSF8EoV1h4WryaNG5N'/>
<!--<image class="input_icon face" src='/images/icons/face.png'/>-->
<image class="input_icon plus" src='http://static.ledouya.com/Fq-0dibiyudlp3SFO6xhl1IMuRq0' @tap="avatar"/>
<view class="send{{readyToSend.length == 0 ? ' hidden' : ''}}" @tap="send">发送</view>
<input @input="input" value="{{readyToSend}}" class="input_text{{focusFlag ? ' focusFlag' : ''}}"
@focus="focus" @blur="blur" @type="input"/>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
import qiniuUploader from '../../api/qiniuUploader';
export default class Input extends wepy.component {
data = {
focusFlag: false,
readyToSend: '',
shopLogo: ''
};
methods = {
send() {
if (this.readyToSend) {
this.$emit('send', {info:this.readyToSend,type:'text'});
}
this.clear();
},
input (evt) {
this.readyToSend = evt.detail.value;
},
focus() {
this.focusFlag = true;
this.$invoke('../chartboard', 'fixPosition', this.focusFlag);
},
blur() {
this.focusFlag = false;
this.$invoke('../chartboard', 'fixPosition', this.focusFlag);
},
async avatar() {
let that = this;
// 获取可添加的图片数量,最多六张
let availableLen = 1 ;
wx.chooseImage({
count: availableLen, // 可上传的数量
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function(res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
let filePath = res.tempFilePaths;
wepy.showLoading();
for (let i = 0; i < filePath.length; i++) {
let path = filePath[i];
// 上传照片
that.$emit('send', {info:path,type: 'image'});
// qiniuUploader.upload(path, (res) => {
// // (res);
// let imgUrl = res.domain + res.truekey + '?imageMogr2/auto-orient';
// // setTimeout(() => { wx.hideLoading(); }, 200);
// // (`图片路径:${imgUrl}`);
// that.shopLogo = imgUrl;
// that.$apply();
// that.$emit('send', {info:that.shopLogo,type: 'image'});
// }, (error) => {
// console.error('error: ' + error);
// }, {
// region: 'ECN', // 华东区
// // uptokenURL: 'https://api.ledianyun.com/api/get/qiniuUploadToken',
// uptokenURL: 'https://api.ledianyun.com/api/get/qiniuUploadToken',
// shouldUseQiniuFileName: false,
// });
}
wepy.hideLoading();
}
})
// wx.chooseImage({
// sourceType : 'album' ,
// success : (res)=>{
// const imgList = res.tempFilePaths;
// for( let i = 0 ; i < imgList.length ; i++ ){
// // let data = {
// // from_user : this.from_user ,
// // to_user : this.to_user ,
// // type : 'image' ,
// // content : imgList[i],
// // isComplete : false ,
// // key : this.key,
// // timestamp : new Date().getTime() / 1000
// // };
// // this.$store.commit('insert_one_record',data);
// // this.$parent.showTools = false;
// this.$emit('send',{info:imgList[i],type: 'image'});
// // setTimeout(()=>{
// // this.$nextTick(()=>{ this.$parent.scrollTop = this.$parent.scrollTop + 1; })
// // },10)
// }
// }
// })
},
};
clear() {
this.readyToSend = '';
}
}
</script>
<template>
<view class="cusomer-box row" @tap="tap({{customer}})">
<image class="avatar icon-xl icon-round" src="{{customer.avatar ? customer.avatar : '/images/icons/customer.png'}}"></image>
<view class="info-box column">
<view class="title-box row">
<text class="xl">{{customer.name ? customer.name : '微信用户'}}</text>
<text class="ml10 xxs muted">{{customer.describe}}</text>
</view>
<view class="count-box row">
<text class="muted">{{customer.key}}</text>
<text class="major ml10"> {{customer.value}}</text>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy'
export default class CustomerItem extends wepy.component {
props = {
customer: {}
};
data = {};
methods = {
tap(customer) {
this.$emit('tap', customer);
}
};
events = {};
onLoad() {
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.cusomer-box{
background-color: white;
padding:30rpx;
border-bottom: $border;
.info-box{
margin-left: 30rpx;
.count-box{
margin-top: 15rpx;
}
}
}
</style>
<template>
<!--会员基本信息-->
<view class="main-container row">
<view class="portrait-container">
<image class="icon-xxl"
src="{{customer.avatar ? customer.avatar: '/images/icons/customer.png'}}"/>
</view>
<view class="user-container column">
<view class="row-between">
<text class="xxl mr20 user-name-box">{{customer.user_name ? customer.user_name : '微信用户'}}</text>
<image class="icon ml20" src="/images/icons/call.png" @tap.stop="phone"/>
</view>
<view class="row">
<text class="lg muted">电话:</text>
<text class="lg muted">{{customer.mobile ? customer.mobile : '暂无电话'}}</text>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
import Tips from '../../utils/Tips';
export default class MemberItem extends wepy.component {
props = {
customer: {}
};
methods = {
phone () {
if (this.customer.mobile) {
wepy.makePhoneCall({phoneNumber: this.customer.mobile});
} else {
Tips.alert('该用户没有电话');
}
}
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.main-container {
background-color: white;
.portrait-container {
padding: 20rpx 30rpx;
}
.user-container{
width: 100%;
margin-right: 30rpx;
}
}
</style>
<style type="scss">
$fontcolor: #7b7b7b;
$activecolor: #13b113;
.message {
background-color: #fff;
.message {
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
image {
height: 96rpx;
width: 96rpx;
border-radius: 50%;
}
.content {
width: 585rpx;
height: 144rpx;
border-bottom: 1rpx #E8E8E8 solid;
display: flex;
flex-direction: column;
justify-content: center;
.name-time {
display: flex;
justify-content: space-between;
align-items: center;
.name {
color: #333333;
font-size: 34rpx;
}
.time {
color: #9B9B9B;
font-size: 22rpx;
}
}
.message-number {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
.messages {
width: 545rpx;
color: #9B9B9B;
font-size: 26rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.number {
width: 30rpx;
height: 30rpx;
border-radius: 50%;
background: #FD3A7F;
color: #FFFFFF;
font-size: 22rpx;
text-align: center;
line-height: 30rpx;
}
}
}
}
}
</style>
<template>
<view class="message">
<view class="message" @tap="select({{chats.uid}},{{chats.avatar}},{{chats.nickname}})">
<image class="img" src="{{chats.avatar}}"></image>
<view class="content">
<view class="name-time">
<view class="name">{{chats.nickname}}</view>
<view class="time">{{chats.date}}</view>
</view>
<view class="message-number">
<view class="messages">{{chats.content ? chats.content: ""}}</view>
<view class="" wx:if="{{chats.unread == 0}}"></view>
<view class="number" wx:elif="{{chats.unread <= 9 && chats.unread > 0}}">{{chats.unread}}</view>
<view class="number" wx:else>..</view>
</view>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
export default class Message extends wepy.component {
props = {
chats: {}
};
methods = {
select(id, avatarUrl, nickName) {
const params = {
id: id,
avatarUrl: avatarUrl,
nickName: nickName
};
this.$root.$navigate('../../pages/customer/chat?param=' + JSON.stringify(params));
}
};
}
</script>
<template>
<view class="item-box">
<view class="goods-box row">
<image class="goods-image" src="{{goods.imageUrl}}"/>
<view class="info-box column">
<view class="title-box">
<text class="title">{{goods.name}}</text>
</view>
<view class="desc-box row">
<text class="muted">购买次数:{{goods.times}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
export default class GoodsItem extends wepy.component {
props = {
goods: {}
};
data = {};
methods = {};
events = {};
onLoad() {
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.item-box {
background-color: #FFF;
margin-top: rpx(10);
position: relative;
.item-action {
border-top: $border;
height: rpx(90);
padding-right: rpx(10);
}
.goods-box {
padding: rpx(30) rpx(20);
$image-size: rpx(130);
.goods-image {
height: $image-size;
width: $image-size;
border: $border;
border-radius: 8px;
}
.icon-recommend {
position: absolute;
height: 25px;
width: 25px;
right: rpx(10);
top: 0;
}
.desc-box {
text {
font-size: $text-sm;
}
}
.info-box {
justify-content: space-between;
min-height: $image-size;
flex: 1;
margin-left: rpx(20);
.title {
line-height: rpx(30);
}
}
}
}
</style>
<template>
<view class="row-between vip-column" @tap="moreVip" wx:if="{{member != null}}">
<image class="card-image" src="/images/icons/vip_card.png"/>
<view class="row-between">
<text class="muted">会员等级 : {{member.discountRule.levelName}}</text>
<view class="vertical-line"/>
<text class="muted">当前积分 : {{member.bonus}}</text>
<image class="icon" src="/images/icons/more-gray.png"/>
</view>
</view>
<view class="row vip-column" @tap="moreVip" wx:if="{{member == null}}">
<image class="card-image" src="/images/icons/vip_card.png"/>
<text class="muted ml20">暂未注册</text>
</view>
</template>
<script>
import wepy from 'wepy';
export default class VipInfo extends wepy.component {
props = {
member: {}
};
methods = {
moreVip () {
this.$emit('moreVip');
}
};
}
</script>
<style lang="scss">
@import "../../styles/variable";
.vip-column {
border: $border;
margin-bottom: 10rpx;
background-color: white;
padding: rpx(20) rpx(30);
.card-image {
width: rpx(50);
height: rpx(50);
margin-right: rpx(20);
}
.vertical-line {
width: rpx(2);
height: rpx(30);
background-color: $color-muted;
}
}
.row-between {
flex: 1;
}
</style>
<template>
<view class="category-box column">
<view class="category-item">
<view>
<text class="xl">{{deliver.name}}</text>
<text class="sm ml10">({{deliver.phone}})</text>
</view>
<view>
<view class="zan-btn zan-btn--small" @tap="delete({{deliver.id}})">删除</view>
<view class="zan-btn zan-btn--small zan-btn--primary" @tap="edit({{deliver}})">编辑</view>
</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
import delivery from '../../api/delivery';
import Tips from '../../utils/Tips';
import Event from '../../utils/Event';
export default class DeliverItem extends wepy.component {
props = {
deliver: {}
};
methods = {
async delete (id) {
await Tips.confirm('确认删除该配送员?');
await delivery.removeDeliver(id);
await Tips.success('删除成功');
Event.emit(Event.DELIVER_LIST_UPDATE);
},
edit (deliver) {
const param = {
mode: 'edit',
deliver: JSON.stringify(deliver)
};
this.$root.$navigate('deliver_edit', param);
}
};
}
</script>
<style lang="scss">
@import "../../styles/variable";
.category-box {
background-color: white;
border-bottom: $border;
border-top: $border;
padding: rpx(20);
margin-top: rpx(10);
.btn-box {
margin-top: rpx(10);
padding-top: rpx(20);
border-top: $border-dot;
}
.category-item {
display: flex;
flex-direction: row;
justify-content: space-between;
text {
line-height: rpx(60);
vertical-align: center;
}
}
}
</style>
<template>
<view class="notice-box column">
<view class="content-box row">
<text class="lg">{{delivery.name}}</text>
<text class="desc inline">¥{{delivery.limitPrice}}起送 | 配送费¥{{delivery.fee}} | {{delivery.location}}</text>
</view>
<view class="btn-box row-end">
<view class="zan-btn zan-btn--small" @tap="delete({{delivery.id}})" >删除</view>
<view class="zan-btn zan-btn--small zan-btn--primary" @tap="edit({{delivery.id}})">编辑</view>
</view>
</view>
</template>
<script>
import wepy from 'wepy';
import Tips from '../../utils/Tips';
import Event from '../../utils/Event';
import delivery from '../../api/delivery';
export default class DeliveryItem extends wepy.component {
props = {
delivery: {}
};
data = {};
methods = {
async delete(id) {
await Tips.confirm('确认删除?');
await delivery.remove(id);
await Tips.success('删除成功');
Event.emit(Event.DELIVERY_LIST_UPDATE);
},
edit(id) {
const param = {
mode: 'edit',
deliveryId: id
}
this.$root.$preload('delivery', this.delivery);
this.$root.$navigate('edit', param);
}
};
events = {};
onLoad() {
}
}
</script>
<style lang="scss">
@import "../../styles/variable";
.notice-box{
background-color: white;
border-bottom: $border;
border-top: $border;
padding: 20rpx;
margin-top: 10rpx;
.content-box{
align-items: flex-end;
.desc{
color: $color-muted;
font-size: $text-sm;
margin-left: 20rpx;
flex: 1;
}
}
.btn-box{
margin-top: 10rpx;
padding-top: 20rpx;
border-top: $border-dot;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!