Browse Source

运费模板

master
杨豪 3 years ago
parent
commit
fd924cce36
  1. 6
      .gitignore
  2. 4
      config/index.js
  3. 21
      dist/mixins/basic.js
  4. 63
      dist/mixins/button.js
  5. 32
      dist/mixins/link.js
  6. 41
      dist/mixins/page-scroll.js
  7. 47
      dist/mixins/touch.js
  8. 156
      dist/mixins/transition.js
  9. 12
      dist/wxs/add-unit.wxs
  10. 5
      dist/wxs/array.wxs
  11. 52
      dist/wxs/bem.wxs
  12. 52
      dist/wxs/memoize.wxs
  13. 10
      dist/wxs/object.wxs
  14. 45
      dist/wxs/style.wxs
  15. 128
      dist/wxs/utils.wxs
  16. 3
      pages.json
  17. 2
      pages/demandHall/index.vue
  18. 36
      pages/life/addGoods/index.vue
  19. 4
      pages/life/tempList/index.vue
  20. 2
      pages/shop/GoodsCon/index.vue

6
.gitignore vendored

@ -3,8 +3,7 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
unpackage/
dist/
unpackage
# Editor directories and files
.idea
@ -16,6 +15,3 @@ dist/
assets/css/style.css
assets/css/style.css.map
.hbuilderx
unpackage/dist
unpackage/resources

4
config/index.js

@ -1,8 +1,8 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
// export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api'
export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api'
// export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api'
export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api'
// export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api'
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';

21
dist/mixins/basic.js vendored

@ -0,0 +1,21 @@
module.exports = {
data() {
return {};
},
props: {},
methods: {
$emit(name, detail, options) {
this.$emit(name, {
detail: detail
}, options);
},
set(data) {
this.setData(data);
return new Promise(resolve => uni.nextTick(resolve));
}
}
};

63
dist/mixins/button.js vendored

@ -0,0 +1,63 @@
import { canIUseGetUserProfile } from '../common/version';
module.exports = {
data() {
return {
canIUseGetUserProfile: canIUseGetUserProfile()
};
},
props: {
id: String,
lang: String,
businessId: Number,
sessionFrom: String,
sendMessageTitle: String,
sendMessagePath: String,
sendMessageImg: String,
showMessageCard: Boolean,
appParameter: String,
ariaLabel: String,
openType: String,
getUserProfileDesc: String
},
externalClasses: ['hover-class'],
methods: {
onGetUserInfo(event) {
this.$emit('getuserinfo', {
detail: event.detail
});
},
onContact(event) {
this.$emit('contact', {
detail: event.detail
});
},
onGetPhoneNumber(event) {
this.$emit('getphonenumber', {
detail: event.detail
});
},
onError(event) {
this.$emit('error', {
detail: event.detail
});
},
onLaunchApp(event) {
this.$emit('launchapp', {
detail: event.detail
});
},
onOpenSetting(event) {
this.$emit('opensetting', {
detail: event.detail
});
}
}
};

32
dist/mixins/link.js vendored

@ -0,0 +1,32 @@
module.exports = {
data() {
return {};
},
props: {
url: String,
linkType: {
type: String,
default: 'navigateTo'
}
},
methods: {
jumpLink(urlKey = 'url') {
const url = this[urlKey];
if (url) {
if (this.linkType === 'navigateTo' && getCurrentPages().length > 9) {
uni.redirectTo({
url
});
} else {
uni[this.linkType]({
url
});
}
}
}
}
};

41
dist/mixins/page-scroll.js vendored

@ -0,0 +1,41 @@
import { getCurrentPage } from '../common/utils';
function onPageScroll(event) {
const {
vanPageScroller = []
} = getCurrentPage();
vanPageScroller.forEach(scroller => {
if (typeof scroller === 'function') {
// @ts-ignore
scroller(event);
}
});
}
module.exports = {
data() {
return {};
},
props: {},
beforeMount() {
const page = getCurrentPage();
if (Array.isArray(page.vanPageScroller)) {
page.vanPageScroller.push(scroller.bind(this));
} else {
page.vanPageScroller = typeof page.onPageScroll === 'function' ? [page.onPageScroll.bind(page), scroller.bind(this)] : [scroller.bind(this)];
}
page.onPageScroll = onPageScroll;
},
destroyed() {
var _a;
const page = getCurrentPage();
page.vanPageScroller = ((_a = page.vanPageScroller) === null || _a === void 0 ? void 0 : _a.filter(item => item !== scroller)) || [];
},
methods: {}
};

47
dist/mixins/touch.js vendored

@ -0,0 +1,47 @@
// @ts-nocheck
const MIN_DISTANCE = 10;
function getDirection(x, y) {
if (x > y && x > MIN_DISTANCE) {
return 'horizontal';
}
if (y > x && y > MIN_DISTANCE) {
return 'vertical';
}
return '';
}
module.exports = {
data() {
return {};
},
props: {},
methods: {
resetTouchStatus() {
this.direction = '';
this.deltaX = 0;
this.deltaY = 0;
this.offsetX = 0;
this.offsetY = 0;
},
touchStart(event) {
this.resetTouchStatus();
const touch = event.touches[0];
this.startX = touch.clientX;
this.startY = touch.clientY;
},
touchMove(event) {
const touch = event.touches[0];
this.deltaX = touch.clientX - this.startX;
this.deltaY = touch.clientY - this.startY;
this.offsetX = Math.abs(this.deltaX);
this.offsetY = Math.abs(this.deltaY);
this.direction = this.direction || getDirection(this.offsetX, this.offsetY);
}
}
};

156
dist/mixins/transition.js vendored

@ -0,0 +1,156 @@
// @ts-nocheck
import { requestAnimationFrame } from '../common/utils';
import { isObj } from '../common/validator';
const getClassNames = name => ({
enter: `van-${name}-enter van-${name}-enter-active enter-class enter-active-class`,
'enter-to': `van-${name}-enter-to van-${name}-enter-active enter-to-class enter-active-class`,
leave: `van-${name}-leave van-${name}-leave-active leave-class leave-active-class`,
'leave-to': `van-${name}-leave-to van-${name}-leave-active leave-to-class leave-active-class`
});
export default function () {
return {
data() {
return {
type: '',
inited: false,
display: false
};
},
props: {
customStyle: String,
// @ts-ignore
show: {
type: Boolean,
default: showDefaultValue
},
// @ts-ignore
duration: {
type: null,
default: 300
},
name: {
type: String,
default: 'fade'
}
},
watch: {
show: {
handler: 'observeShow',
immediate: true
},
duration: {
handler: 'observeDuration',
immediate: true
}
},
mounted() {
if (this.show === true) {
this.observeShow(true, false);
}
},
methods: {
observeShow(value, old) {
if (value === old) {
return;
}
value ? this.enter() : this.leave();
},
enter() {
const {
duration,
name
} = this;
const classNames = getClassNames(name);
const currentDuration = isObj(duration) ? duration.enter : duration;
this.status = 'enter';
this.$emit('before-enter');
requestAnimationFrame(() => {
if (this.status !== 'enter') {
return;
}
this.$emit('enter');
this.setData({
inited: true,
display: true,
classes: classNames.enter,
currentDuration
});
requestAnimationFrame(() => {
if (this.status !== 'enter') {
return;
}
this.transitionEnded = false;
this.setData({
classes: classNames['enter-to']
});
});
});
},
leave() {
if (!this.display) {
return;
}
const {
duration,
name
} = this;
const classNames = getClassNames(name);
const currentDuration = isObj(duration) ? duration.leave : duration;
this.status = 'leave';
this.$emit('before-leave');
requestAnimationFrame(() => {
if (this.status !== 'leave') {
return;
}
this.$emit('leave');
this.setData({
classes: classNames.leave,
currentDuration
});
requestAnimationFrame(() => {
if (this.status !== 'leave') {
return;
}
this.transitionEnded = false;
setTimeout(() => this.onTransitionEnd(), currentDuration);
this.setData({
classes: classNames['leave-to']
});
});
});
},
onTransitionEnd() {
if (this.transitionEnded) {
return;
}
this.transitionEnded = true;
this.$emit(`after-${this.status}`);
const {
show,
display
} = this;
if (!show && display) {
this.setData({
display: false
});
}
}
}
};
}

12
dist/wxs/add-unit.wxs vendored

@ -0,0 +1,12 @@
/* eslint-disable */
var REGEXP = getRegExp('^-?\d+(\.\d+)?$');
function addUnit(value) {
if (value == null) {
return undefined;
}
return REGEXP.test('' + value) ? value + 'px' : value;
}
module.exports = addUnit;

5
dist/wxs/array.wxs vendored

@ -0,0 +1,5 @@
function isArray(array) {
return array && array.constructor === 'Array';
}
module.exports.isArray = isArray;

52
dist/wxs/bem.wxs vendored

@ -0,0 +1,52 @@
/* eslint-disable */
///////////////////////////////////dist\wxs\array.wxs/////////////////////////////////
function isArray(array) {
return array && array.constructor === 'Array';
}
/* eslint-disable */
///////////////////////////////////dist\wxs\object.wxs/////////////////////////////////
var REGEXP = getRegExp('{|}|"', 'g');
function keys(obj) {
return JSON.stringify(obj).replace(REGEXP, '').split(',').map(function (item) {
return item.split(':')[0];
});
}
var PREFIX = 'van-';
function join(name, mods) {
name = PREFIX + name;
mods = mods.map(function (mod) {
return name + '--' + mod;
});
mods.unshift(name);
return mods.join(' ');
}
function traversing(mods, conf) {
if (!conf) {
return;
}
if (typeof conf === 'string' || typeof conf === 'number') {
mods.push(conf);
} else if (isArray(conf)) {
conf.forEach(function (item) {
traversing(mods, item);
});
} else if (typeof conf === 'object') {
keys(conf).forEach(function (key) {
conf[key] && mods.push(key);
});
}
}
function bem(name, conf) {
var mods = [];
traversing(mods, conf);
return join(name, mods);
}
module.exports = bem;

52
dist/wxs/memoize.wxs vendored

@ -0,0 +1,52 @@
/**
* Simple memoize
* wxs doesn't support fn.apply, so this memoize only support up to 2 args
*/
/* eslint-disable */
function isPrimitive(value) {
var type = typeof value;
return type === 'boolean' || type === 'number' || type === 'string' || type === 'undefined' || value === null;
} // mock simple fn.call in wxs
function call(fn, args) {
if (args.length === 2) {
return fn(args[0], args[1]);
}
if (args.length === 1) {
return fn(args[0]);
}
return fn();
}
function serializer(args) {
if (args.length === 1 && isPrimitive(args[0])) {
return args[0];
}
var obj = {};
for (var i = 0; i < args.length; i++) {
obj['key' + i] = args[i];
}
return JSON.stringify(obj);
}
function memoize(fn) {
var cache = {};
return function () {
var key = serializer(arguments);
if (cache[key] === undefined) {
cache[key] = call(fn, arguments);
}
return cache[key];
};
}
module.exports = memoize;

10
dist/wxs/object.wxs vendored

@ -0,0 +1,10 @@
/* eslint-disable */
var REGEXP = getRegExp('{|}|"', 'g');
function keys(obj) {
return JSON.stringify(obj).replace(REGEXP, '').split(',').map(function (item) {
return item.split(':')[0];
});
}
module.exports.keys = keys;

45
dist/wxs/style.wxs vendored

@ -0,0 +1,45 @@
/* eslint-disable */
/* eslint-disable */
///////////////////////////////////dist\wxs\object.wxs/////////////////////////////////
var REGEXP = getRegExp('{|}|"', 'g');
function keys(obj) {
return JSON.stringify(obj).replace(REGEXP, '').split(',').map(function (item) {
return item.split(':')[0];
});
}
///////////////////////////////////dist\wxs\array.wxs/////////////////////////////////
function isArray(array) {
return array && array.constructor === 'Array';
}
function kebabCase(word) {
var newWord = word.replace(getRegExp("[A-Z]", 'g'), function (i) {
return '-' + i;
}).toLowerCase();
return newWord;
}
function style(styles) {
if (isArray(styles)) {
return styles.filter(function (item) {
return item != null && item !== '';
}).map(function (item) {
return style(item);
}).join(';');
}
if ('Object' === styles.constructor) {
return keys(styles).filter(function (key) {
return styles[key] != null && styles[key] !== '';
}).map(function (key) {
return [kebabCase(key), [styles[key]]].join(':');
}).join(';');
}
return styles;
}
module.exports = style;

128
dist/wxs/utils.wxs vendored

@ -0,0 +1,128 @@
/* eslint-disable */
///////////////////////////////////dist\wxs\array.wxs/////////////////////////////////
/* eslint-disable */
///////////////////////////////////dist\wxs\bem.wxs/////////////////////////////////
function isArray(array) {
return array && array.constructor === 'Array';
}
/* eslint-disable */
///////////////////////////////////dist\wxs\object.wxs/////////////////////////////////
var REGEXP = getRegExp('{|}|"', 'g');
function keys(obj) {
return JSON.stringify(obj).replace(REGEXP, '').split(',').map(function (item) {
return item.split(':')[0];
});
}
var PREFIX = 'van-';
function join(name, mods) {
name = PREFIX + name;
mods = mods.map(function (mod) {
return name + '--' + mod;
});
mods.unshift(name);
return mods.join(' ');
}
function traversing(mods, conf) {
if (!conf) {
return;
}
if (typeof conf === 'string' || typeof conf === 'number') {
mods.push(conf);
} else if (isArray(conf)) {
conf.forEach(function (item) {
traversing(mods, item);
});
} else if (typeof conf === 'object') {
keys(conf).forEach(function (key) {
conf[key] && mods.push(key);
});
}
}
function bem(name, conf) {
var mods = [];
traversing(mods, conf);
return join(name, mods);
}
module.exports = bem;
/**
* Simple memoize
* wxs doesn't support fn.apply, so this memoize only support up to 2 args
*/
/* eslint-disable */
///////////////////////////////////dist\wxs\memoize.wxs/////////////////////////////////
function isPrimitive(value) {
var type = typeof value;
return type === 'boolean' || type === 'number' || type === 'string' || type === 'undefined' || value === null;
} // mock simple fn.call in wxs
function call(fn, args) {
if (args.length === 2) {
return fn(args[0], args[1]);
}
if (args.length === 1) {
return fn(args[0]);
}
return fn();
}
function serializer(args) {
if (args.length === 1 && isPrimitive(args[0])) {
return args[0];
}
var obj = {};
for (var i = 0; i < args.length; i++) {
obj['key' + i] = args[i];
}
return JSON.stringify(obj);
}
function memoize(fn) {
var cache = {};
return function () {
var key = serializer(arguments);
if (cache[key] === undefined) {
cache[key] = call(fn, arguments);
}
return cache[key];
};
}
module.exports = memoize;
/* eslint-disable */
///////////////////////////////////dist\wxs\add-unit.wxs/////////////////////////////////
var REGEXP = getRegExp('^-?\d+(\.\d+)?$');
function addUnit(value) {
if (value == null) {
return undefined;
}
return REGEXP.test('' + value) ? value + 'px' : value;
}
module.exports = addUnit;
module.exports = {
bem: memoize(bem),
memoize: memoize,
addUnit: addUnit
};

3
pages.json

@ -268,7 +268,8 @@
{
"path": "pages/life/tempList/index",
"style": {
"navigationBarTitleText": "运费模板列表"
"navigationBarTitleText": "运费模板列表",
"enablePullDownRefresh": true
}
},
{

2
pages/demandHall/index.vue

@ -627,7 +627,7 @@ image{
border-bottom: 2rpx solid #EEEEEE;
}
.title-box .title{
width: 550rpx;
width: 500rpx;
}
.title-box .price{
margin: 0;

36
pages/life/addGoods/index.vue

@ -156,7 +156,7 @@
<view class="o-name-box">
<block v-for="(o,i) in attr.detail" :key="i">
<view class="o-item-box acea-row row-between row-middle">
<input type="text" v-model="attr.detail[i]" maxlength="10" placeholder="输入选项,如:红色,10个字以内">
<input type="text" v-model="attr.detail[i]" placeholder="输入选项,如:红色">
<text class="close" @click="delOption(i)">×</text>
</view>
</block>
@ -182,7 +182,7 @@
slider_image: [] ,//
description: '', //
tempId: 1, //
temp: '全国包邮',
temp: '默认免邮',
attrs: [ //
{
pic: '', //" --",
@ -206,19 +206,6 @@
}
},
onLoad() {
// var arr = [
// {value: "", detail: [""]},
// {value: "", detail: ["29cm", "30cm"]}
// ]
// let result = arr.reduce((res, item) => {
// return item.detail.reduce((list, ci) => {
// let nobj = {[item.value]: ci}
// let narr = res.length ? res.map(r => ({...r, ...nobj})) : [nobj]
// return list.concat(narr)
// }, [])
// }, [])
// console.log(result)
this.id = this.$yroute.query.id || ''
if(this.id){
uni.setNavigationBarTitle({
@ -244,12 +231,6 @@
this.attrs[0].price = info.price
this.attrs[0].stock = info.stock
}
// this.batchData.titleStr = strArr.join('/')
// this.$set(this.batchData,'titleStr',strArr.join('/'))
// this.$set(this.batchData,'attrArr',attrArr)
}).then(()=>{
// this.getFormatAttr()
})
} else{
console.log('新增')
@ -307,7 +288,6 @@
},
delAttr(i){
this.attrArr.splice(i,1)
// this.setBatchData(this.attrArr)
this.getFormatAttr()
},
addOption(){
@ -346,6 +326,7 @@
this.addOptionsDialog = false
this.maskShow = false
},
//
getFormatAttr(){
let data = { attrs: this.items, productId: this.id || 0 }
getFormatAttr(data).then((res)=>{
@ -363,13 +344,13 @@
}
})
},
//
//
setBatchData(arr){
var titleArr = []
// for (var i in arr) {
// titleArr.push(arr[i].value)
// }
// var titleStr = titleArr.join('/')
for (var i in arr) {
titleArr.push(arr[i].value)
}
var titleStr = titleArr.join('/')
var attrArr = this.setData(arr)
var branchList = []
var hash = {}
@ -395,7 +376,6 @@
for (var i in attrArr) {
tmp.push(attrArr[i].detail)
}
console.log(tmp,'tmp')
function cartesianProductOf() {
return Array.prototype.reduce.call(arguments, function (a, b) {
var ret = [];

4
pages/life/tempList/index.vue

@ -27,6 +27,9 @@
},
mounted(){
},
onPullDownRefresh(){
this.getTempList()
},
methods:{
choseTemp(item){
@ -49,6 +52,7 @@
getTempList().then((res)=>{
// console.log(res)
this.tempList = res.data.content
uni.stopPullDownRefresh()
})
},
toTemp(){

2
pages/shop/GoodsCon/index.vue

@ -420,7 +420,7 @@ export default {
})
getProductDetail(that.id, from)
.then(res => {
res.data.storeInfo.description = res.data.storeInfo.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
res.data.storeInfo.description = res.data.storeInfo.description.replace(/\<img/g, "<img style='max-width: 100%;height:auto;display:block;'")
that.$set(that, 'storeInfo', res.data.storeInfo)
// attr attr
that.$set(that.attr, 'productAttr', res.data.productAttr)

Loading…
Cancel
Save