This commit is contained in:
2024-08-22 12:53:28 +08:00
commit 1d65a849fd
360 changed files with 41757 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
Array.prototype.includes || Object.defineProperty(Array.prototype, "includes", {
value: function(r, e) {
if (null == this) throw new TypeError('"this" is null or not defined');
var t = Object(this), n = t.length >>> 0;
if (0 == n) return !1;
for (var i, o, a = 0 | e, u = Math.max(0 <= a ? a : n - Math.abs(a), 0); u < n; ) {
if ((i = t[u]) === (o = r) || "number" == typeof i && "number" == typeof o && isNaN(i) && isNaN(o)) return !0;
u++;
}
return !1;
}
});

View File

@@ -0,0 +1,7 @@
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = new Array(a); e < a; e++) n[e] = r[e];
return n;
}
module.exports = _arrayLikeToArray;

View File

@@ -0,0 +1,7 @@
var arrayLikeToArray = require("./arrayLikeToArray");
function _arrayWithoutHoles(r) {
if (Array.isArray(r)) return arrayLikeToArray(r);
}
module.exports = _arrayWithoutHoles;

View File

@@ -0,0 +1,26 @@
function asyncGeneratorStep(n, e, r, t, o, a, c) {
try {
var i = n[a](c), u = i.value;
} catch (n) {
return void r(n);
}
i.done ? e(u) : Promise.resolve(u).then(t, o);
}
function _asyncToGenerator(n) {
return function() {
var e = this, r = arguments;
return new Promise(function(t, o) {
var a = n.apply(e, r);
function c(n) {
asyncGeneratorStep(a, t, o, c, i, "next", n);
}
function i(n) {
asyncGeneratorStep(a, t, o, c, i, "throw", n);
}
c(void 0);
});
};
}
module.exports = _asyncToGenerator;

View File

@@ -0,0 +1,10 @@
function _defineProperty(e, r, n) {
return r in e ? Object.defineProperty(e, r, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = n, e;
}
module.exports = _defineProperty;

View File

@@ -0,0 +1,7 @@
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
};
}
module.exports = _interopRequireDefault;

View File

@@ -0,0 +1,5 @@
function _iterableToArray(r) {
if ("undefined" != typeof Symbol && Symbol.iterator in Object(r)) return Array.from(r);
}
module.exports = _iterableToArray;

View File

@@ -0,0 +1,5 @@
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
module.exports = _nonIterableSpread;

View File

@@ -0,0 +1,7 @@
var arrayWithoutHoles = require("./arrayWithoutHoles"), iterableToArray = require("./iterableToArray"), unsupportedIterableToArray = require("./unsupportedIterableToArray"), nonIterableSpread = require("./nonIterableSpread");
function _toConsumableArray(r) {
return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();
}
module.exports = _toConsumableArray;

View File

@@ -0,0 +1,9 @@
function _typeof(o) {
return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? module.exports = _typeof = function(o) {
return typeof o;
} : module.exports = _typeof = function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
module.exports = _typeof;

View File

@@ -0,0 +1,11 @@
var arrayLikeToArray = require("./arrayLikeToArray");
function _unsupportedIterableToArray(r, e) {
if (r) {
if ("string" == typeof r) return arrayLikeToArray(r, e);
var t = Object.prototype.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, e) : void 0;
}
}
module.exports = _unsupportedIterableToArray;

View File

@@ -0,0 +1,273 @@
!function(t) {
"use strict";
var r, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", c = o.toStringTag || "@@toStringTag", u = "object" == typeof module, h = t.regeneratorRuntime;
if (h) u && (module.exports = h); else {
(h = t.regeneratorRuntime = u ? module.exports : {}).wrap = w;
var f = "suspendedStart", s = "suspendedYield", l = "executing", p = "completed", y = {}, v = {};
v[i] = function() {
return this;
};
var d = Object.getPrototypeOf, g = d && d(d(P([])));
g && g !== e && n.call(g, i) && (v = g);
var m = b.prototype = x.prototype = Object.create(v);
E.prototype = m.constructor = b, b.constructor = E, b[c] = E.displayName = "GeneratorFunction",
h.isGeneratorFunction = function(t) {
var r = "function" == typeof t && t.constructor;
return !!r && (r === E || "GeneratorFunction" === (r.displayName || r.name));
}, h.mark = function(t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, b) : (t.__proto__ = b, c in t || (t[c] = "GeneratorFunction")),
t.prototype = Object.create(m), t;
}, h.awrap = function(t) {
return {
__await: t
};
}, _(j.prototype), j.prototype[a] = function() {
return this;
}, h.AsyncIterator = j, h.async = function(t, r, e, n) {
var o = new j(w(t, r, e, n));
return h.isGeneratorFunction(r) ? o : o.next().then(function(t) {
return t.done ? t.value : o.next();
});
}, _(m), m[c] = "Generator", m[i] = function() {
return this;
}, m.toString = function() {
return "[object Generator]";
}, h.keys = function(t) {
var r = [];
for (var e in t) r.push(e);
return r.reverse(), function e() {
for (;r.length; ) {
var n = r.pop();
if (n in t) return e.value = n, e.done = !1, e;
}
return e.done = !0, e;
};
}, h.values = P, N.prototype = {
constructor: N,
reset: function(t) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = r, this.done = !1, this.delegate = null,
this.method = "next", this.arg = r, this.tryEntries.forEach(G), !t) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = r);
},
stop: function() {
this.done = !0;
var t = this.tryEntries[0].completion;
if ("throw" === t.type) throw t.arg;
return this.rval;
},
dispatchException: function(t) {
if (this.done) throw t;
var e = this;
function o(n, o) {
return c.type = "throw", c.arg = t, e.next = n, o && (e.method = "next", e.arg = r),
!!o;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var a = this.tryEntries[i], c = a.completion;
if ("root" === a.tryLoc) return o("end");
if (a.tryLoc <= this.prev) {
var u = n.call(a, "catchLoc"), h = n.call(a, "finallyLoc");
if (u && h) {
if (this.prev < a.catchLoc) return o(a.catchLoc, !0);
if (this.prev < a.finallyLoc) return o(a.finallyLoc);
} else if (u) {
if (this.prev < a.catchLoc) return o(a.catchLoc, !0);
} else {
if (!h) throw new Error("try statement without catch or finally");
if (this.prev < a.finallyLoc) return o(a.finallyLoc);
}
}
}
},
abrupt: function(t, r) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var o = this.tryEntries[e];
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var i = o;
break;
}
}
i && ("break" === t || "continue" === t) && i.tryLoc <= r && r <= i.finallyLoc && (i = null);
var a = i ? i.completion : {};
return a.type = t, a.arg = r, i ? (this.method = "next", this.next = i.finallyLoc,
y) : this.complete(a);
},
complete: function(t, r) {
if ("throw" === t.type) throw t.arg;
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg,
this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r),
y;
},
finish: function(t) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var e = this.tryEntries[r];
if (e.finallyLoc === t) return this.complete(e.completion, e.afterLoc), G(e), y;
}
},
catch: function(t) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var e = this.tryEntries[r];
if (e.tryLoc === t) {
var n = e.completion;
if ("throw" === n.type) {
var o = n.arg;
G(e);
}
return o;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function(t, e, n) {
return this.delegate = {
iterator: P(t),
resultName: e,
nextLoc: n
}, "next" === this.method && (this.arg = r), y;
}
};
}
function w(t, r, e, n) {
var o = r && r.prototype instanceof x ? r : x, i = Object.create(o.prototype), a = new N(n || []);
return i._invoke = function(t, r, e) {
var n = f;
return function(o, i) {
if (n === l) throw new Error("Generator is already running");
if (n === p) {
if ("throw" === o) throw i;
return F();
}
for (e.method = o, e.arg = i; ;) {
var a = e.delegate;
if (a) {
var c = O(a, e);
if (c) {
if (c === y) continue;
return c;
}
}
if ("next" === e.method) e.sent = e._sent = e.arg; else if ("throw" === e.method) {
if (n === f) throw n = p, e.arg;
e.dispatchException(e.arg);
} else "return" === e.method && e.abrupt("return", e.arg);
n = l;
var u = L(t, r, e);
if ("normal" === u.type) {
if (n = e.done ? p : s, u.arg === y) continue;
return {
value: u.arg,
done: e.done
};
}
"throw" === u.type && (n = p, e.method = "throw", e.arg = u.arg);
}
};
}(t, e, a), i;
}
function L(t, r, e) {
try {
return {
type: "normal",
arg: t.call(r, e)
};
} catch (t) {
return {
type: "throw",
arg: t
};
}
}
function x() {}
function E() {}
function b() {}
function _(t) {
[ "next", "throw", "return" ].forEach(function(r) {
t[r] = function(t) {
return this._invoke(r, t);
};
});
}
function j(t) {
var r;
this._invoke = function(e, o) {
function i() {
return new Promise(function(r, i) {
!function r(e, o, i, a) {
var c = L(t[e], t, o);
if ("throw" !== c.type) {
var u = c.arg, h = u.value;
return h && "object" == typeof h && n.call(h, "__await") ? Promise.resolve(h.__await).then(function(t) {
r("next", t, i, a);
}, function(t) {
r("throw", t, i, a);
}) : Promise.resolve(h).then(function(t) {
u.value = t, i(u);
}, function(t) {
return r("throw", t, i, a);
});
}
a(c.arg);
}(e, o, r, i);
});
}
return r = r ? r.then(i, i) : i();
};
}
function O(t, e) {
var n = t.iterator[e.method];
if (n === r) {
if (e.delegate = null, "throw" === e.method) {
if (t.iterator.return && (e.method = "return", e.arg = r, O(t, e), "throw" === e.method)) return y;
e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method");
}
return y;
}
var o = L(n, t.iterator, e.arg);
if ("throw" === o.type) return e.method = "throw", e.arg = o.arg, e.delegate = null,
y;
var i = o.arg;
return i ? i.done ? (e[t.resultName] = i.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next",
e.arg = r), e.delegate = null, y) : i : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"),
e.delegate = null, y);
}
function k(t) {
var r = {
tryLoc: t[0]
};
1 in t && (r.catchLoc = t[1]), 2 in t && (r.finallyLoc = t[2], r.afterLoc = t[3]),
this.tryEntries.push(r);
}
function G(t) {
var r = t.completion || {};
r.type = "normal", delete r.arg, t.completion = r;
}
function N(t) {
this.tryEntries = [ {
tryLoc: "root"
} ], t.forEach(k, this), this.reset(!0);
}
function P(t) {
if (t) {
var e = t[i];
if (e) return e.call(t);
if ("function" == typeof t.next) return t;
if (!isNaN(t.length)) {
var o = -1, a = function e() {
for (;++o < t.length; ) if (n.call(t, o)) return e.value = t[o], e.done = !1, e;
return e.value = r, e.done = !0, e;
};
return a.next = a;
}
}
return {
next: F
};
}
function F() {
return {
value: r,
done: !0
};
}
}(function() {
return this || "object" == typeof self && self;
}() || Function("return this")());

178
wx214944c362629fc7/app.js Normal file
View File

@@ -0,0 +1,178 @@
var t = require("@babel/runtime/helpers/interopRequireDefault"), o = require("@babel/runtime/helpers/typeof"), e = t(require("siteinfo.js")), n = [ "pages/index/index", "pages/category/index", "pages/flow/index", "pages/user/index" ];
App({
globalData: {
user_id: null
},
api_root: "",
onLaunch: function() {
this.setApiRoot();
},
onShow: function(t) {},
setApiRoot: function() {
this.api_root = "".concat(e.default.siteroot, "index.php?s=/api/");
},
getWxappBase: function(t) {
this._get("wxapp/base", {}, function(o) {
wx.setStorageSync("wxapp", o.data.wxapp), console.log("sss", o), wx.setStorageSync("storedata", o.data.shdata),
wx.setStorageSync("values", o.data.values), t && t(o.data.wxapp);
}, !1, !1);
},
doLogin: function() {
var t = getCurrentPages();
if (t.length) {
var o = t[t.length - 1];
"pages/login/login" != o.route && wx.setStorageSync("currentPage", o);
}
wx.navigateTo({
url: "/pages/login/login"
});
},
getUserId: function() {
return wx.getStorageSync("user_id") || 0;
},
showSuccess: function(t, o) {
wx.showToast({
title: t,
icon: "success",
success: function() {
o && setTimeout(function() {
o();
}, 1500);
}
});
},
showError: function(t, o) {
wx.showModal({
title: "友情提示",
content: t,
showCancel: !1,
success: function(t) {
o && o();
}
});
},
_get: function(t, e, n, a, i, r) {
var s = this;
wx.showNavigationBarLoading(), e = Object.assign({
wxapp_id: 10001,
token: wx.getStorageSync("token")
}, e);
var c = function() {
e.token = wx.getStorageSync("token"), wx.request({
url: s.api_root + t,
header: {
"content-type": "application/json"
},
data: e,
success: function(t) {
if (200 !== t.statusCode || "object" !== o(t.data)) return console.log(t), s.showError("网络请求出错"),
!1;
if (-1 === t.data.code) wx.hideNavigationBarLoading(), s.doLogin(); else {
if (0 === t.data.code) return s.showError(t.data.msg), !1;
n && n(t.data);
}
},
fail: function(t) {
s.showError(t.errMsg, function() {
a && a(t);
});
},
complete: function(t) {
wx.hideNavigationBarLoading(), i && i(t);
}
});
};
r ? s.doLogin(c) : c();
},
_post_form: function(t, e, n, a, i) {
wx.showNavigationBarLoading();
var r = this;
e = Object.assign({
wxapp_id: 10001,
token: wx.getStorageSync("token")
}, e), wx.request({
url: r.api_root + t,
header: {
"content-type": "application/x-www-form-urlencoded"
},
method: "POST",
data: e,
success: function(i) {
return 200 !== i.statusCode || "object" !== o(i.data) ? (r.showError("网络请求出错"),
!1) : -1 === i.data.code ? (r.doLogin(function() {
r._post_form(t, e, n, a);
}), !1) : 0 === i.data.code ? (r.showError(i.data.msg, function() {
a && a(i);
}), !1) : void (n && n(i.data));
},
fail: function(t) {
r.showError(t.errMsg, function() {
a && a(t);
});
},
complete: function(t) {
wx.hideLoading(), wx.hideNavigationBarLoading(), i && i(t);
}
});
},
validateUserInfo: function() {
wx.getStorageSync("user_info");
return !!wx.getStorageSync("user_info");
},
urlEncode: function(t) {
var o = [];
for (var e in t) {
var n = t[e];
n.constructor == Array ? n.forEach(function(t) {
o.push(e + "=" + t);
}) : o.push(e + "=" + n);
}
return o.join("&");
},
setTitle: function() {
var t, o = this;
(t = wx.getStorageSync("wxapp")) ? wx.setNavigationBarTitle({
title: t.navbar.wxapp_title
}) : o.getWxappBase(function() {
o.setTitle();
});
},
setNavigationBar: function() {
this.getWxappBase(function(t) {
wx.setNavigationBarColor({
frontColor: t.navbar.top_text_color.text,
backgroundColor: t.navbar.top_background_color
});
});
},
getTabBarLinks: function() {
return n;
},
checkIsLogin: function() {
return "" != wx.getStorageSync("token") && "" != wx.getStorageSync("user_id");
},
getUserInfo: function(t, o) {
var e = this;
wx.showLoading({
title: "正在登录",
mask: !0
});
var n = wx.getStorageSync("she");
wx.login({
success: function(a) {
e._post_form("user/login", {
code: a.code,
user_info: JSON.stringify(t),
she: JSON.stringify(n)
}, function(t) {
wx.setStorageSync("token", t.data.token), wx.setStorageSync("user_id", t.data.user_id),
wx.setStorageSync("phone", t.data.user.phone), wx.setStorageSync("utype", t.data.user.utype),
o && o();
}, !1, function() {
wx.hideLoading();
});
}
});
}
});

View File

@@ -0,0 +1,66 @@
{
"pages": [
"pages/index/index",
"pages/index_back/index",
"pages/category/index",
"pages/category/list",
"pages/goods/index",
"pages/search/index",
"pages/flow/index",
"pages/flow/checkout",
"pages/user/index",
"pages/user/help",
"pages/order/index",
"pages/order/detail",
"pages/address/index",
"pages/address/create",
"pages/address/detail",
"pages/login/login",
"pages/aftermarket/create",
"pages/aftermarket/index",
"pages/gongzuo/index",
"pages/pays/pays",
"pages/phone/phone",
"pages/address/webvue",
"pages/user/she",
"pages/user/daililist",
"pages/user/yonghulist",
"pages/user/onyongjinjilu",
"pages/user/tx",
"pages/user/txlist"
],
"window": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTitleText": "",
"navigationBarTextStyle": "black",
"backgroundTextStyle": "dark"
},
"tabBar": {
"color": "#6e6d6b",
"selectedColor": "#ff9966",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/tabBar/home.png",
"selectedIconPath": "images/tabBar/home_on.png"
},
{
"pagePath": "pages/flow/index",
"text": "购物车",
"iconPath": "images/tabBar/cart.png",
"selectedIconPath": "images/tabBar/cart_on.png"
},
{
"pagePath": "pages/user/index",
"text": "我的",
"iconPath": "images/tabBar/user.png",
"selectedIconPath": "images/tabBar/user_on.png"
}
],
"position": "bottom"
},
"debug": false
}

1195
wx214944c362629fc7/app.wxss Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,293 @@
var e = require("../../@babel/runtime/helpers/interopRequireDefault")(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/asyncToGenerator"), a = require("../../@babel/runtime/helpers/toConsumableArray"), i = require("../../@babel/runtime/helpers/defineProperty");
Component({
options: {
multipleSlots: !0
},
properties: {
previewSize: {
type: Number,
value: 100
},
defaultGoodsId: {
type: Number,
value: 0,
observer: function(e) {
console.log("id", e), null == this.data.goodsId ? this.setData({
goodsId: e
}) : (console.log("来新的了"), this.setData({
goodsId: e,
newGoods: !0
}));
}
},
defaultImgUrlList: {
type: Array,
value: [],
observer: function(e) {
null != e && e.length && !this.data.imageUrlList.length ? (console.log("初始化-defaultImgUrlList"),
this.setData({
imageUrlList: e
})) : (console.log("未初始化aaa-defaultImgUrlList"), this.data.newGoods && (console.log("初始化bbb-defaultImgUrlList"),
this.setData({
imageUrlList: e
})));
}
},
defaultImgList: {
type: Array,
value: [],
observer: function(e) {
if (null != e && e.length && !this.data.dragImgList.length) {
console.log("初始化-defaultImgList");
var t = this.getDragImgList(e);
this.setUploaPosition(t.length), this.setData({
dragImgList: t
});
} else if (console.log("未初始化aaa-defaultImgList"), this.data.newGoods) {
console.log("初始化bbb-defaultImgList");
var a = this.getDragImgList(e);
this.setUploaPosition(a.length), this.setData({
dragImgList: a
});
}
}
},
maxCount: {
type: Number,
value: 9
},
columns: {
type: Number,
value: 3
},
gap: {
type: Number,
value: 9
},
deleteStyle: {
type: String,
value: ""
}
},
data: {
goodsId: null,
newGoods: !1,
imageUrlList: [],
dragImgList: [],
containerRes: {
top: 0,
left: 0,
width: 0,
height: 0
},
currentKey: -1,
currentIndex: -1,
tranX: 0,
tranY: 0,
uploadPosition: {
tranX: 0,
tranY: 0
}
},
lifetimes: {
ready: function() {
var e = this;
this.createSelectorQuery().select(".drag-container").boundingClientRect(function(t) {
var a, r = t.top, n = t.left;
e.setData((i(a = {}, "containerRes.top", r), i(a, "containerRes.left", n), a));
}).exec();
}
},
methods: {
longPress: function(e) {
var t = e.mark.index, a = e.touches[0], i = a.pageX, r = a.pageY, n = this.data, o = n.previewSize, s = n.containerRes, l = s.top, u = s.left;
this.setData({
currentIndex: t,
tranX: i - o / 2 - u,
tranY: r - o / 2 - l
});
},
touchMove: function(e) {
if (!(this.data.currentIndex < 0)) {
var t = e.touches[0], a = t.pageX, i = t.pageY, r = this.data, n = r.previewSize, o = r.containerRes, s = o.top, l = a - n / 2 - o.left, u = i - n / 2 - s;
this.setData({
tranX: l,
tranY: u
});
var g = e.mark.key, c = this.getMoveKey(l, u);
g !== c && this.data.currentKey !== g && (this.data.currentKey = g, this.replace(g, c));
}
},
getMoveKey: function(e, t) {
var a = this.data, i = a.dragImgList, r = a.previewSize, n = a.columns, o = function(e, t) {
var a = Math.round(e / r);
return a >= t ? t - 1 : a < 0 ? 0 : a;
}, s = n * o(t, Math.ceil(i.length / n)) + o(e, n);
return s >= i.length ? i.length - 1 : s;
},
replace: function(e, t) {
var a = this.data.dragImgList;
console.log("dragImgList", a), a.forEach(function(a) {
e < t ? a.key > e && a.key <= t ? a.key-- : a.key === e && (a.key = t) : e > t && (a.key >= t && a.key < e ? a.key++ : a.key === e && (a.key = t));
}), this.getListPosition(a);
},
getListPosition: function(e) {
var t = this.data, a = t.previewSize, i = t.columns, r = t.gap, n = e.map(function(e) {
return e.tranX = (a + r) * (e.key % i), e.tranY = Math.floor(e.key / i) * (a + r),
e;
});
this.setData({
dragImgList: n
}), this.updateEvent(n);
},
touchEnd: function() {
this.setData({
tranX: 0,
tranY: 0,
currentIndex: -1
}), this.data.currentKey = -1;
},
updateEvent: function(e) {
console.log(e);
var t = a(e).sort(function(e, t) {
return e.key - t.key;
}).map(function(e) {
return {
src: e.src,
image_id: e.imageId
};
});
this.triggerEvent("updateImageList", {
list: t
});
},
preview: function(e) {
var t = e.currentTarget.dataset.src;
console.log(t);
var a = this.data.imageUrlList;
console.log(a), wx.previewImage({
current: t,
urls: a
});
},
uploadImage: function() {
var a = this;
return t(e.default.mark(function t() {
var i, r, n, o, s, l, u;
return e.default.wrap(function(e) {
for (;;) switch (e.prev = e.next) {
case 0:
return i = a, r = a.data, n = r.dragImgList, o = r.maxCount, e.prev = 2, e.next = 5,
wx.chooseMedia({
count: o - n.length,
mediaType: [ "image" ],
sourceType: [ "album", "camera" ],
maxDuration: 30,
sizeType: [ "compressed" ],
camera: "back"
});
case 5:
if (s = e.sent, console.log("res", s), "chooseMedia:ok" == s.errMsg) {
e.next = 10;
break;
}
return wx.showToast({
title: "上传失败",
icon: "none",
duration: 3e3
}), e.abrupt("return");
case 10:
if ("image" == s.type) {
e.next = 13;
break;
}
return wx.showToast({
title: "只能上传图片类型",
icon: "none",
duration: 3e3
}), e.abrupt("return");
case 13:
for (wx.showLoading({
title: "图片上传中"
}), l = s.tempFiles, u = 0; u < l.length; u++) wx.uploadFile({
name: "iFile",
url: "https://ltwxminiapp.19year.cn/index.php?s=/api/upload/image&wxapp_id=10001",
filePath: l[u].tempFilePath,
success: function(e) {
console.log("resp", e);
var t = JSON.parse(e.data);
if (console.log("resp", t), 1 == t.code) {
var a = i.data.imageUrlList, r = {
file_path: t.data.file_path,
image_id: parseInt(t.data.file_id)
};
console.log("imageObj", r);
var o = i.getDragImgList([ r ], !1);
n = n.concat(o), i.setUploaPosition(n.length), a.push(t.data.file_path), i.setData({
dragImgList: n,
imageUrlList: a
}), i.updateEvent(n), wx.hideLoading();
} else wx.hideLoading(), wx.showModal({
title: "提示",
content: "上传失败",
showCancel: !1
});
}
});
e.next = 21;
break;
case 18:
e.prev = 18, e.t0 = e.catch(2), console.log(e.t0);
case 21:
case "end":
return e.stop();
}
}, t, null, [ [ 2, 18 ] ]);
}))();
},
getContainerRect: function(e) {
var t = this.data, a = t.columns, i = t.previewSize, r = t.maxCount, n = t.gap, o = e === r ? e : e + 1, s = Math.ceil(o / a);
return {
width: a * i + (a - 1) * n,
height: s * i + n * (s - 1)
};
},
getDragImgList: function(e) {
var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], a = this.data, i = a.dragImgList, r = a.previewSize, n = a.columns, o = a.gap;
return e.map(function(e, a) {
var s = (t ? 0 : i.length) + a;
return {
tranX: (r + o) * (s % n),
tranY: Math.floor(s / n) * (r + o),
src: e.file_path,
id: s,
key: s,
imageId: e.image_id
};
});
},
setUploaPosition: function(e) {
var t, a = this.data, r = a.previewSize, n = a.columns, o = a.gap, s = {
tranX: e % n * (r + o),
tranY: Math.floor(e / n) * (r + o)
}, l = this.getContainerRect(e), u = l.width, g = l.height;
this.setData((i(t = {
uploadPosition: s
}, "containerRes.width", u), i(t, "containerRes.height", g), t));
},
deleteImg: function(e) {
var t = e.mark.key, a = this.data.dragImgList.filter(function(e) {
return e.key !== t;
});
a.forEach(function(e) {
e.key > t && e.key--;
}), this.getListPosition(a), this.setUploaPosition(a.length);
}
}
});

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,16 @@
<view class="drag-container" style="width: {{containerRes.width}}px; height: {{containerRes.height}}px;">
<view catch:longpress="longPress" catch:touchend="touchEnd" catch:touchmove="touchMove" class="drag-item drag-item-transition" mark:index="{{index}}" mark:key="{{item.key}}" style="transform: translate({{index===currentIndex?tranX:item.tranX}}px, {{index===currentIndex?tranY:item.tranY}}px); z-index: {{index===currentIndex?10:1}}; width: {{previewSize}}px; height: {{previewSize}}px;" wx:for="{{dragImgList}}" wx:key="id">
<image bindtap="preview" class="drag-item-img" data-list="{{dragImgList}}" data-src="{{item.src}}" mode="aspectFill" src="{{item.src}}"></image>
<view catch:tap="deleteImg" class="drag-item-delete" mark:key="{{item.key}}">
<view class="drag-item-delete_default" style="{{deleteStyle}}">x</view>
</view>
</view>
<view bindtap="uploadImage" class="drag-item drag-upload" hidden="{{dragImgList.length>=maxCount}}" style="transform: translate({{uploadPosition.tranX}}px, {{uploadPosition.tranY}}px); width: {{previewSize}}px; height: {{previewSize}}px;">
<view class="drag-upload_solt">
<slot name="upload"></slot>
</view>
<view class="drag-upload_default">
<text>+</text>
</view>
</view>
</view>

View File

@@ -0,0 +1,52 @@
.drag-container {
position: relative;
}
.drag-item {
left: 0;
position: absolute;
top: 0;
}
.drag-item-transition {
transition: transform .1s;
transition: transform .1s,-webkit-transform .1s;
}
.drag-item-img {
height: 100%;
width: 100%;
}
.drag-item-delete {
position: absolute;
right: 0;
top: 0;
}
.drag-item-delete_default {
background-color: rgba(0,0,0,.7);
border-radius: 0 0 0 12px;
color: #fefefe;
display: flex;
height: 15px;
justify-content: center;
line-height: 10px;
width: 21px;
}
.drag-upload .drag-upload_solt:empty+.drag-upload_default {
border: 2px dashed;
box-sizing: border-box;
display: block;
font-size: 70px;
font-weight: 700;
height: 100%;
line-height: 100%;
text-align: center;
width: 100%;
}
.drag-upload .drag-upload_default {
display: none;
}

View File

@@ -0,0 +1,31 @@
var t = getApp();
Component({
options: {
multipleSlots: !0
},
properties: {
title: {
type: String,
value: "弹窗标题"
}
},
data: {
isShow: !1,
transparent: !0
},
methods: {
_onToggleShow: function(t) {
this.setData({
isShow: !this.data.isShow,
transparent: !1
});
},
_onTargetPage: function(a) {
var e = t.getTabBarLinks();
wx.switchTab({
url: "/" + e[a.detail.target.dataset.index]
});
}
}
});

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,22 @@
<view class="shortcut">
<form bindsubmit="_onTargetPage">
<button class="nav-item btn-normal {{isShow?'show_60':transparent?'':'hide_60'}}" data-index="0" formType="submit">
<text class="iconfont icon-home"></text>
</button>
</form>
<form bindsubmit="_onTargetPage">
<button class="nav-item btn-normal {{isShow?'show_40':transparent?'':'hide_40'}}" data-index="2" formType="submit">
<text class="iconfont icon-cart"></text>
</button>
</form>
<form bindsubmit="_onTargetPage">
<button class="nav-item btn-normal {{isShow?'show_20':transparent?'':'hide_20'}}" data-index="3" formType="submit">
<text class="iconfont icon-profile"></text>
</button>
</form>
<form bindsubmit="_onToggleShow">
<button class="nav-item nav-item__switch btn-normal {{isShow?'shortcut_click_show':''}}" formType="submit">
<text class="iconfont icon-daohang"></text>
</button>
</form>
</view>

View File

@@ -0,0 +1,626 @@
./utils/iconfont.wxssrpx.container,wx-input {
-webkit-font-smoothing: antialiased;
font-family: PingFang-Medium,PingFangSC-Regular,Heiti,Heiti SC,DroidSans,DroidSansFallback,Microsoft YaHei,sans-serif;
}
.b-f {
background: #fff;
}
.tf-180 {
transform: rotate(-180deg);
}
.tf-90 {
transform: rotate(90deg);
}
.dis-block {
display: block;
}
.dis-flex {
display: flex!important;
}
.flex-box {
flex: 1;
}
.flex-dir-row {
flex-direction: row;
}
.flex-dir-column {
flex-direction: column;
}
.flex-x-center {
justify-content: center;
}
.flex-x-between {
justify-content: space-between;
}
.flex-x-around {
justify-content: space-around;
}
.flex-x-end {
justify-content: flex-end;
}
.flex-y-center {
align-items: center;
}
.flex-y-end {
align-items: flex-end;
}
.flex-five {
box-sizing: border-box;
flex: 0 0 50%;
}
.flex-three {
float: left;
width: 33.3%;
}
.flex-four {
box-sizing: border-box;
flex: 0 0 25%;
}
.t-l {
text-align: left;
}
.t-c {
text-align: center;
}
.t-r {
text-align: right;
}
.p-a {
position: absolute;
}
.p-r {
position: relative;
}
.fl {
float: left;
}
.fr {
float: right;
}
.clear::after {
clear: both;
content: " ";
display: table;
}
.oh {
overflow: hidden;
}
.tb-lr-center {
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex!important;
display: flex!important;
justify-content: center;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-30 {
font-size: 30rpx;
}
.f-29 {
font-size: 29rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-25 {
font-size: 25rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.f-w {
font-weight: 700;
}
.f-n {
font-weight: 400;
}
.col-f {
color: #fff;
}
.col-3 {
color: #333;
}
.col-6 {
color: #666;
}
.col-7 {
color: #777;
}
.col-8 {
color: #888;
}
.col-9 {
color: #999;
}
.col-m {
color: #ff495e!important;
}
.col-s {
color: #be0117!important;
}
.col-green {
color: #0ed339!important;
}
.cont-box {
padding: 20rpx;
}
.cont-bot {
margin-bottom: 120rpx;
}
.padding-box {
box-sizing: border-box;
padding: 0 24rpx;
}
.pl-12 {
padding-left: 12px;
}
.pr-12 {
padding-right: 12px;
}
.pr-6 {
padding-right: 6px;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.p-bottom {
padding-bottom: 112rpx;
}
.onelist-hidden {
white-space: nowrap;
}
.onelist-hidden,.twolist-hidden {
overflow: hidden;
text-overflow: ellipsis;
}
.twolist-hidden {
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
display: -webkit-box;
word-break: break-all;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.ts-1 {
transition: all .1s;
}
.ts-2 {
transition: all .2s;
}
.ts-3 {
transition: all .3s;
}
.ts-5 {
transition: all .5s;
}
.btn-normal {
background: none;
border: none;
border-radius: 0;
box-shadow: none;
display: block;
font-size: unset;
line-height: normal;
margin: 0;
overflow: visible;
padding: 0;
text-align: unset;
}
.btn-normal:after {
border: none;
}
.btn-normal.button-hover {
color: inherit;
}
.shortcut {
bottom: 250rpx;
line-height: 1;
position: fixed;
right: 12px;
z-index: 5;
}
.nav-item,.shortcut {
border-radius: 50%;
width: 76rpx;
}
.nav-item {
background: rgba(0,0,0,.4);
bottom: 0;
color: #fff;
height: 76rpx;
line-height: 76rpx;
opacity: 0;
padding: 0;
position: absolute;
text-align: center;
transform: rotate(0deg);
}
.nav-item text {
font-size: 40rpx;
}
.nav-item__switch {
opacity: 1;
}
.shortcut_click_show {
background: #ff5454;
margin-bottom: 0;
}
.show_80 {
animation: show_80 .3s forwards;
bottom: 384rpx;
}
.show_60 {
animation: show_60 .3s forwards;
bottom: 288rpx;
}
.show_40 {
animation: show_40 .3s forwards;
bottom: 192rpx;
}
.show_20 {
animation: show_20 .3s forwards;
bottom: 96rpx;
}
@-webkit-keyframes show_20 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 96rpx;
opacity: 1;
transform: rotate(1turn);
}
}
@keyframes show_20 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 96rpx;
opacity: 1;
transform: rotate(1turn);
}
}
@-webkit-keyframes show_40 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 192rpx;
opacity: 1;
transform: rotate(1turn);
}
}
@keyframes show_40 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 192rpx;
opacity: 1;
transform: rotate(1turn);
}
}
@-webkit-keyframes show_60 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 288rpx;
opacity: 1;
transform: rotate(1turn);
}
}
@keyframes show_60 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 288rpx;
opacity: 1;
transform: rotate(1turn);
}
}
@-webkit-keyframes show_80 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 384rpx;
opacity: 1;
transform: rotate(1turn);
}
}
@keyframes show_80 {
from {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
to {
bottom: 384rpx;
opacity: 1;
transform: rotate(1turn);
}
}
.hide_80 {
animation: hide_80 .3s;
}
.hide_60,.hide_80 {
bottom: 0;
opacity: 0;
}
.hide_60 {
animation: hide_60 .3s;
}
.hide_40 {
animation: hide_40 .3s;
}
.hide_20,.hide_40 {
bottom: 0;
opacity: 0;
}
.hide_20 {
animation: hide_20 .3s;
}
@-webkit-keyframes hide_20 {
from {
bottom: 96rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}
@keyframes hide_20 {
from {
bottom: 96rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}
@-webkit-keyframes hide_40 {
from {
bottom: 192rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}
@keyframes hide_40 {
from {
bottom: 192rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}
@-webkit-keyframes hide_60 {
from {
bottom: 288rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}
@keyframes hide_60 {
from {
bottom: 288rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}
@-webkit-keyframes hide_80 {
from {
bottom: 384rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}
@keyframes hide_80 {
from {
bottom: 384rpx;
opacity: 1;
transform: rotate(1turn);
}
to {
bottom: 0;
opacity: 0;
transform: rotate(0deg);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,51 @@
var e = getApp();
Page({
data: {
disabled: !1,
nav_select: !1,
name: "",
region: "",
phone: "",
detail: "",
error: ""
},
onLoad: function(e) {},
saveData: function(a) {
var t = this, n = a.detail.value;
if (n.region = t.data.region, !t.validation(n)) return e.showError(t.data.error),
!1;
t.setData({
disabled: !0
}), e._post_form("address/add", n, function(a) {
e.showSuccess(a.msg, function() {
wx.navigateBack();
});
}, !1, function() {
t.setData({
disabled: !1
});
});
},
validation: function(e) {
if ("" === e.name) return this.data.error = "收件人不能为空", !1;
if (e.phone.length < 1) return this.data.error = "手机号不能为空", !1;
return /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/.test(e.phone) ? this.data.region ? "" !== e.detail || (this.data.error = "详细地址不能为空",
!1) : (this.data.error = "省市区不能空", !1) : (this.data.error = "手机号不符合要求", !1);
},
bindRegionChange: function(e) {
this.setData({
region: e.detail.value
});
},
webvue1: function() {
console.log(111), wx.navigateTo({
url: "webvue?id=1"
});
},
webvue2: function() {
console.log(111), wx.navigateTo({
url: "webvue?id=2"
});
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "新增收货地址",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,52 @@
<view class="container">
<view class="common-header-xian"></view>
<form bindsubmit="saveData">
<view class="address-cont-title b-f b-b">
<view class="list address-box dis-flex b-b">
<view class="left-name">
<text class="f-30">收货人</text>
</view>
<view class="right-cont flex-box">
<input name="name" placeholder="请输入收货人姓名" value="{{name}}"></input>
</view>
</view>
<view class="list address-box dis-flex">
<view class="left-name">
<text class="f-30">手机号</text>
</view>
<view class="right-cont flex-box">
<input name="phone" placeholder="请输入收货人联系电话" type="number" value="{{phone}}"></input>
</view>
</view>
</view>
<view class="address-cont-title b-f b-b">
<view class="dis-flex list address-box m-top20 b-b">
<view class="left-name">
<text class="f-30">所在地区</text>
</view>
<view class="address-cont-box flex-box">
<picker bindchange="bindRegionChange" mode="region">
<text class="f-30" wx:if="{{region}}">{{region}}</text>
<text class="f-30 col-7" wx:else>选择省、市、区</text>
</picker>
</view>
</view>
<view class="dis-flex list address-box">
<view class="left-name">
<text class="f-30">详细地址</text>
</view>
<view class="right-cont flex-box">
<input name="detail" placeholder="请输入街道小区楼层" type="text" value="{{detail}}"></input>
</view>
</view>
</view>
<view class="padding-box m-top20 profile-btn">
<button disabled="{{disabled}}" formType="submit">保存</button>
</view>
</form>
<view>
<view bindtap="webvue1" style="color: blue;"> 《用户服务协议》 </view>
<view bindtap="webvue2" style="color: blue;"> 《隐私政策》 </view>
</view>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,172 @@
.profile-list .admin {
color: #333;
font-size: 30rpx;
padding-left: 15px;
}
.address-box .left-name {
width: 85px;
}
.address-cont-title .list {
padding: 24rpx;
width: auto;
}
.tui-picker-detail text {
padding: 0 10rpx;
}
.infoText {
display: block;
line-height: 56rpx;
}
picker-view {
background-color: #fff;
bottom: 0;
height: 480rpx;
padding: 0;
position: fixed;
width: 100%;
}
picker-view-column view {
align-items: center;
display: flex;
font-size: 28rpx;
height: 100%;
justify-content: center;
line-height: 28rpx;
vertical-align: middle;
}
.animation-element-wrapper {
height: 100%;
left: 0;
top: 0;
z-index: 21;
}
.animation-element,.animation-element-wrapper {
display: flex;
position: fixed;
width: 100%;
}
.animation-element {
background-color: #fff;
bottom: 0;
height: 570rpx;
}
.animation-button {
align-items: center;
height: 100rpx;
line-height: 100rpx;
margin-top: 20rpx;
top: 20rpx;
width: 400rpx;
}
.address-text {
color: #999;
display: inline-flex;
font-family: Arial,Helvetica,sans-serif;
font-size: 30rpx;
height: 50rpx;
line-height: 50rpx;
margin-top: 20rpx;
position: fixed;
text-align: center;
}
.left-bt {
left: 30rpx;
}
.right-bt {
color: #ec5151;
right: 30rpx;
}
.line {
background-color: #eee;
display: block;
height: 1rpx;
margin-top: 89rpx;
position: fixed;
width: 100%;
}
.address-box .right-cont input {
color: #444;
font-size: 30rpx;
width: 100%;
}
.bargain-commont-bg {
background: rgba(0,0,0,.6);
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 20;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.m-top35 {
margin-top: 35rpx;
}

View File

@@ -0,0 +1,49 @@
var a = getApp();
Page({
data: {
disabled: !1,
nav_select: !1,
region: "",
detail: {},
error: ""
},
onLoad: function(a) {
this.getAddressDetail(a.address_id);
},
getAddressDetail: function(t) {
var e = this;
a._get("address/detail", {
address_id: t
}, function(a) {
e.setData(a.data);
});
},
saveData: function(t) {
var e = this, d = t.detail.value;
if (d.region = e.data.region, !e.validation(d)) return a.showError(e.data.error),
!1;
e.setData({
disabled: !0
}), d.address_id = e.data.detail.address_id, a._post_form("address/edit", d, function(t) {
a.showSuccess(t.msg, function() {
wx.navigateBack();
});
}, !1, function() {
e.setData({
disabled: !1
});
});
},
validation: function(a) {
if ("" === a.name) return this.data.error = "收件人不能为空", !1;
if (a.phone.length < 1) return this.data.error = "手机号不能为空", !1;
return /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/.test(a.phone) ? this.data.region ? "" !== a.detail || (this.data.error = "详细地址不能为空",
!1) : (this.data.error = "省市区不能空", !1) : (this.data.error = "手机号不符合要求", !1);
},
bindRegionChange: function(a) {
this.setData({
region: a.detail.value
});
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "编辑收货地址",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,48 @@
<view class="container">
<view class="common-header-xian"></view>
<form bindsubmit="saveData">
<view class="address-cont-title b-f b-b">
<view class="list address-box dis-flex b-b">
<view class="left-name">
<text class="f-30">收货人</text>
</view>
<view class="right-cont flex-box">
<input name="name" placeholder="请输入收货人姓名" value="{{detail.name}}"></input>
</view>
</view>
<view class="list address-box dis-flex">
<view class="left-name">
<text class="f-30">手机号</text>
</view>
<view class="right-cont flex-box">
<input name="phone" placeholder="请输入收货人联系电话" type="number" value="{{detail.phone}}"></input>
</view>
</view>
</view>
<view class="address-cont-title b-f b-b">
<view class="dis-flex list address-box m-top20 b-b">
<view class="left-name">
<text class="f-30">所在地区</text>
</view>
<view class="address-cont-box flex-box">
<picker bindchange="bindRegionChange" mode="region" value="{{region}}">
<text class="f-30" wx:if="{{region.length}}">{{region}}</text>
<text class="f-30 col-7" wx:else>选择省、市、区</text>
</picker>
</view>
</view>
<view class="dis-flex list address-box">
<view class="left-name">
<text class="f-30">详细地址</text>
</view>
<view class="right-cont flex-box">
<input name="detail" placeholder="请输入街道小区楼层" type="text" value="{{detail.detail}}"></input>
</view>
</view>
</view>
<view class="padding-box m-top20 profile-btn">
<button disabled="{{disabled}}" formType="submit">保存</button>
</view>
</form>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,172 @@
.profile-list .admin {
color: #333;
font-size: 30rpx;
padding-left: 15px;
}
.address-box .left-name {
width: 85px;
}
.address-cont-title .list {
padding: 24rpx;
width: auto;
}
.tui-picker-detail text {
padding: 0 10rpx;
}
.infoText {
display: block;
line-height: 56rpx;
}
picker-view {
background-color: #fff;
bottom: 0;
height: 480rpx;
padding: 0;
position: fixed;
width: 100%;
}
picker-view-column view {
align-items: center;
display: flex;
font-size: 28rpx;
height: 100%;
justify-content: center;
line-height: 28rpx;
vertical-align: middle;
}
.animation-element-wrapper {
height: 100%;
left: 0;
top: 0;
z-index: 21;
}
.animation-element,.animation-element-wrapper {
display: flex;
position: fixed;
width: 100%;
}
.animation-element {
background-color: #fff;
bottom: 0;
height: 570rpx;
}
.animation-button {
align-items: center;
height: 100rpx;
line-height: 100rpx;
margin-top: 20rpx;
top: 20rpx;
width: 400rpx;
}
.address-text {
color: #999;
display: inline-flex;
font-family: Arial,Helvetica,sans-serif;
font-size: 30rpx;
height: 50rpx;
line-height: 50rpx;
margin-top: 20rpx;
position: fixed;
text-align: center;
}
.left-bt {
left: 30rpx;
}
.right-bt {
color: #ec5151;
right: 30rpx;
}
.line {
background-color: #eee;
display: block;
height: 1rpx;
margin-top: 89rpx;
position: fixed;
width: 100%;
}
.address-box .right-cont input {
color: #444;
font-size: 30rpx;
width: 100%;
}
.bargain-commont-bg {
background: rgba(0,0,0,.6);
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 20;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.m-top35 {
margin-top: 35rpx;
}

View File

@@ -0,0 +1,54 @@
var t = getApp();
Page({
data: {
list: [],
default_id: null
},
onLoad: function(t) {
this.data.options = t;
},
onShow: function() {
this.getAddressList();
},
getAddressList: function() {
var e = this;
t._get("address/lists", {}, function(t) {
e.setData(t.data);
});
},
createAddress: function() {
wx.navigateTo({
url: "./create"
});
},
editAddress: function(t) {
wx.navigateTo({
url: "./detail?address_id=" + t.currentTarget.dataset.id
});
},
removeAddress: function(e) {
var s = this, a = e.currentTarget.dataset.id;
wx.showModal({
title: "提示",
content: "您确定要移除当前收货地址吗?",
success: function(e) {
e.confirm && t._post_form("address/delete", {
address_id: a
}, function(t) {
s.getAddressList();
});
}
});
},
setDefault: function(e) {
var s = this, a = e.detail.value;
return s.setData({
default_id: parseInt(a)
}), t._post_form("address/setDefault", {
address_id: a
}, function(t) {
"flow" === s.data.options.from && wx.navigateBack();
}), !1;
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "收货地址",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,45 @@
<view class="container m-b6 p-bottom">
<view class="common-header-xian"></view>
<custom-ul class="addres-list" wx:if="{{list.length}}">
<custom-li wx:for="{{list}}" wx:key="this">
<view class="address-header b-f m-top18">
<view class="flow-header-left pl-12">
<view class="flow-checkout-admin">{{item.name}} <text>{{item.phone}}</text>
</view>
<view class="flow-checkout-address"> {{item.region.province}} {{item.region.city}} {{item.region.region}} {{item.detail}} </view>
</view>
</view>
<view class="address-list dis-flex b-f">
<view class="list address-left">
<radio-group bindchange="setDefault" class="radio-group">
<label class="radio">
<radio checked="{{item.address_id==default_id}}" color="#ff495e" value="{{item.address_id}}"></radio>
<text class="cont" wx:if="{{item.address_id==default_id}}">默认</text>
<text class="cont" wx:else>选择</text>
</label>
</radio-group>
</view>
<view class="list address-right dis-flex">
<view bindtap="editAddress" data-id="{{item.address_id}}">
<text class="iconfont icon-edit"></text>
<text class="title">编辑</text>
</view>
<view bindtap="removeAddress" data-id="{{item.address_id}}">
<text class="iconfont icon-lajixiang"></text>
<text class="title">删除</text>
</view>
</view>
</view>
</custom-li>
</custom-ul>
<view wx:else>
<view class="yoshop-notcont">
<text class="iconfont icon-ziyuan"></text>
<text class="cont">亲,您还没有收货列表</text>
</view>
</view>
<view class="footer-fixed f-32">
<view bindtap="createAddress" class="order-bt" style="width:100%">添加新地址</view>
</view>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,100 @@
.address-list {
border-bottom: 1px solid #f6f6f9;
}
.address-list .list {
padding: 15rpx;
}
.address-list .list .title {
color: #666;
font-size: 30rpx;
padding: 0 24rpx 0 6rpx;
}
.address-list .list .cont {
color: #333;
font-size: 30rpx;
}
.address-list .list navigator {
display: inline-block;
}
.address-list .list image {
height: 28rpx;
width: 28rpx;
}
.address-left {
flex: 6;
}
.address-right {
flex: 3.2;
}
.address-right .iconfont {
color: #777;
font-size: 30rpx;
}
.flow-fixed-footer {
background: #f42424;
bottom: 0;
position: fixed;
width: 100%;
z-index: 4999;
}
.flow-fixed-footer .chackout-left {
color: #777;
font-size: 32rpx;
line-height: 44px;
}
.flow-fixed-footer .chackout-right {
font-size: 34rpx;
}
.address-header {
background-size: 120rpx auto;
border-bottom: 1px solid #f6f6f9;
font-size: 1.7rem;
padding: 28rpx 0;
}
.flow-header-left {
flex: 14;
padding: 0rpx 20rpx;
}
.flow-header-right {
flex: 1;
}
.flow-header-right image {
float: right;
height: 34rpx;
margin-top: 20rpx;
width: 34rpx;
}
.address-header .flow-checkout-admin {
color: #444;
font-size: 34rpx;
}
.address-header .flow-checkout-admin text {
padding: 0 10rpx;
}
.address-header .flow-checkout-address {
color: #777;
font-size: 26rpx;
margin-top: 6rpx;
}
.radio-group raido {
color: #f42424;
}

View File

@@ -0,0 +1,14 @@
Page({
data: {
url2: "https://ltwxminiapp.19year.cn/2.html",
url1: "https://ltwxminiapp.19year.cn/1.html",
url: ""
},
onLoad: function(t) {
console.log("id", t.id), "1" == t.id ? (console.log(1), this.setData({
url: "https://ltwxminiapp.19year.cn/1.html?dat=" + Date.now()
})) : (console.log(2), this.setData({
url: "https://ltwxminiapp.19year.cn/2.html?dat=" + Date.now()
})), console.log(this.url);
}
});

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "说明",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<web-view src="{{url}}"></web-view>

View File

@@ -0,0 +1,68 @@
var e = getApp();
Page({
data: {
disabled: !1,
nav_select: !1,
name: "",
region: "",
phone: "",
detail: "",
error: "",
order_goods_id: 0,
info: {}
},
onLoad: function(e) {
this.data.order_goods_id = e.order_goods_id, this.getOrderDetail(e.order_goods_id);
},
goodsDetail: function(e) {
var t = e.currentTarget.dataset.id;
wx.navigateTo({
url: "../goods/index?goods_id=" + t
});
},
getOrderDetail: function(t) {
var a = this;
e._get("user.order_goods/getOrderGoods", {
order_goods_id: t
}, function(e) {
e.data.info.aftermarket_apply_date = a.formatDate(1e3 * e.data.info.aftermarket_apply_time),
e.data.info.aftermarket_dispose_date = a.formatDate(1e3 * e.data.info.aftermarket_dispose_time),
a.setData(e.data);
});
},
formatDate: function(e) {
var t = new Date(e), a = t.getFullYear(), r = t.getMonth() + 1;
r = r < 10 ? "0" + r : r;
var o = t.getDate();
o = o < 10 ? "0" + o : o;
var d = t.getHours();
d = d < 10 ? "0" + d : d;
var i = t.getMinutes(), n = t.getSeconds();
return a + "-" + r + "-" + o + " " + d + ":" + (i = i < 10 ? "0" + i : i) + ":" + (n = n < 10 ? "0" + n : n);
},
saveData: function(t) {
var a = this, r = t.detail.value;
if (r.order_goods_id = a.data.order_goods_id, !a.validation(r)) return e.showError(a.data.error),
!1;
a.setData({
disabled: !0
}), e._post_form("user.order_goods/submitAftermarket", r, function(t) {
if (console.log(t), 1 != t.code) return e.showError(t.msg), !1;
a.getOrderDetail(a.data.order_goods_id);
}, !1, function() {
a.setData({
disabled: !1
});
});
},
validation: function(e) {
return "" === e.refund_reason ? (this.data.error = "退款原因不能为空", !1) : 20 != this.data.info.order.delivery_status || "" !== e.deliver_no || (this.data.error = "快递单号不能为空",
!1);
},
bindRegionChange: function(e) {
this.setData({
region: e.detail.value
});
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "售后详情",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,85 @@
<view class="container">
<view class="common-header-xian"></view>
<view class="order-cont b-f m-top20">
<view class="padding-box b-f">
<view class="order-header dis-flex">
<view class="flex-box t-l">
<text class="title">商品详情</text>
</view>
</view>
</view>
<view class="padding-box b-f">
<view class="order-cont dis-flex">
<view class="order-num"></view>
<view class="order-time">
<text>{{order.create_time}}</text>
</view>
</view>
</view>
</view>
<view class="padding-box b-f">
<view bindtap="goodsDetail" class="dis-flex flow-shopList b-f" data-id="{{info.goods_id}}">
<view class="flow-list-left">
<image mode="scaleToFill" src="{{info.image.file_path}}"></image>
</view>
<view class="flow-list-right">
<text class="h4 twolist-hidden">{{info.goods_name}}</text>
<text class="p f-22 col-7">{{info.goods_attr}}</text>
<view class="flow-list-cont">
<text class="flow-cont">¥{{info.goods_price}}</text>
<text class="small">×{{info.total_num}}</text>
</view>
<view></view>
</view>
</view>
</view>
<form bindsubmit="saveData" wx:if="{{info.refund_status==0}}">
<view class="address-cont-title b-f b-b">
<view class="list address-box dis-flex b-b">
<view class="left-name">
<text class="f-30">退款原因</text>
</view>
<view class="right-cont flex-box">
<input name="refund_reason" placeholder="请输入退款原因" value=""></input>
</view>
</view>
<view class="list address-box dis-flex" wx:if="{{info.order.delivery_status.value==20}}">
<view class="left-name">
<text class="f-30">快递单号</text>
</view>
<view class="right-cont flex-box">
<input name="deliver_no" placeholder="请输入快递单号" value=""></input>
</view>
</view>
</view>
<view class="address-cont-title b-f b-b"></view>
<view class="padding-box m-top20 profile-btn">
<button disabled="{{disabled}}" formType="submit">提交</button>
</view>
</form>
<view class="flow-all-money b-f padding-box m-top20" wx:if="{{info.refund_status>0}}">
<view class="dis-flex flow-all-list-cont1">
<text class="col-16">退款单号: {{info.refund_no}}</text>
</view>
<view class="dis-flex flow-all-list-cont1">
<text class="col-16">退款原因: {{info.refund_reason}}</text>
</view>
<view class="dis-flex flow-all-list-cont1" wx:if="{{info.deliver_no.length>0}}">
<text class="col-16" selectable="{{true}}">快递单号: {{info.deliver_no}}</text>
</view>
<view class="dis-flex flow-all-list-cont1">
<text class="col-16" selectable="{{true}}" wx:if="{{info.refund_status==1}}">退款状态: 已申请</text>
<text class="col-16" selectable="{{true}}" wx:if="{{info.refund_status==2}}">退款状态: 已退款 </text>
</view>
<view class="dis-flex flow-all-list-cont1">
<text class="col-16" selectable="{{true}}">申请时间: {{info.aftermarket_apply_date}}</text>
</view>
<view class="dis-flex flow-all-list-cont1" wx:if="{{info.refund_status==2}}">
<text class="col-16" selectable="{{true}}">完成时间: {{info.aftermarket_dispose_date}} </text>
</view>
<view class="dis-flex flow-all-list-cont1" wx:if="{{info.refund_status==2}}">
<text class="col-16" selectable="{{true}}">退款金额: ¥{{info.refund_price}} </text>
</view>
</view>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,224 @@
.profile-list .admin {
color: #333;
font-size: 30rpx;
padding-left: 15px;
}
.address-box .left-name {
width: 85px;
}
.address-cont-title .list {
padding: 24rpx;
width: auto;
}
.tui-picker-detail text {
padding: 0 10rpx;
}
.infoText {
display: block;
line-height: 56rpx;
}
picker-view {
background-color: #fff;
bottom: 0;
height: 480rpx;
padding: 0;
position: fixed;
width: 100%;
}
picker-view-column view {
align-items: center;
display: flex;
font-size: 28rpx;
height: 100%;
justify-content: center;
line-height: 28rpx;
vertical-align: middle;
}
.animation-element-wrapper {
height: 100%;
left: 0;
top: 0;
z-index: 21;
}
.animation-element,.animation-element-wrapper {
display: flex;
position: fixed;
width: 100%;
}
.animation-element {
background-color: #fff;
bottom: 0;
height: 570rpx;
}
.animation-button {
align-items: center;
height: 100rpx;
line-height: 100rpx;
margin-top: 20rpx;
top: 20rpx;
width: 400rpx;
}
.address-text {
color: #999;
display: inline-flex;
font-family: Arial,Helvetica,sans-serif;
font-size: 30rpx;
height: 50rpx;
line-height: 50rpx;
margin-top: 20rpx;
position: fixed;
text-align: center;
}
.left-bt {
left: 30rpx;
}
.right-bt {
color: #ec5151;
right: 30rpx;
}
.line {
background-color: #eee;
display: block;
height: 1rpx;
margin-top: 89rpx;
position: fixed;
width: 100%;
}
.address-box .right-cont input {
color: #444;
font-size: 30rpx;
width: 100%;
}
.bargain-commont-bg {
background: rgba(0,0,0,.6);
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
z-index: 20;
}
.f-34 {
font-size: 34rpx;
}
.f-32 {
font-size: 32rpx;
}
.f-31 {
font-size: 31rpx;
}
.f-28 {
font-size: 28rpx;
}
.f-26 {
font-size: 26rpx;
}
.f-24 {
font-size: 24rpx;
}
.f-22 {
font-size: 22rpx;
}
.b-r {
border-right: 1rpx solid #eee;
}
.b-b {
border-bottom: 1rpx solid #eee;
}
.b-t {
border-top: 1rpx solid #eee;
}
.m-top4 {
margin-top: 4rpx;
}
.m-top10 {
margin-top: 10rpx;
}
.m-top20 {
margin-top: 25rpx;
}
.m-top35 {
margin-top: 35rpx;
}
.flow-list .header {
background: #fff;
border-bottom: 1rpx solid #f1f1f1;
padding: 15rpx 0;
position: relative;
}
.flow-list .header text {
font-size: 32rpx;
padding-left: 80rpx;
}
.flow-list .header image {
height: 37rpx;
left: 15px;
margin-top: -18rpx;
position: absolute;
top: 50%;
width: 34rpx;
}
.order-header {
border-bottom: 1rpx solid #f1f1f1;
padding: 15rpx 0;
}
.order-header text {
font-size: 28rpx;
}
.order-header text.title {
color: #333;
}
.order-cont {
justify-content: space-between;
}
.order-cont .order-num text,.order-cont .time {
color: #888;
}
.order-cont .order-num text,.order-cont .order-time text {
color: #777;
font-size: 26rpx;
}
.flow-all-list-cont1 {
font-size: 32rpx;
padding: 10rpx 0;
}

View File

@@ -0,0 +1,86 @@
var t = getApp();
Page({
data: {
dataType: "all",
data: []
},
onLoad: function(t) {
this.data.dataType = t.type || "all", this.setData({
dataType: this.data.dataType
});
},
onShow: function() {
this.getOrderList(this.data.dataType);
},
formatDate: function(t) {
var e = new Date(t), a = e.getFullYear(), r = e.getMonth() + 1;
r = r < 10 ? "0" + r : r;
var d = e.getDate();
d = d < 10 ? "0" + d : d;
var o = e.getHours();
o = o < 10 ? "0" + o : o;
var n = e.getMinutes(), i = e.getSeconds();
return a + "-" + r + "-" + d + " " + o + ":" + (n = n < 10 ? "0" + n : n) + ":" + (i = i < 10 ? "0" + i : i);
},
getOrderList: function(e) {
var a = this;
t._get("user.order_goods/getOrderGoodsList", {
dataType: e
}, function(t) {
t.data.length && wx.pageScrollTo({
scrollTop: 0
});
for (var e = 0; e < t.data.length; e++) t.data[e].aftermarket_apply_date = a.formatDate(1e3 * t.data[e].aftermarket_apply_time);
a.setData(t);
});
},
bindHeaderTap: function(t) {
this.setData({
dataType: t.target.dataset.type
}), this.getOrderList(t.target.dataset.type);
},
cancelOrder: function(e) {
var a = this, r = e.currentTarget.dataset.id;
wx.showModal({
title: "提示",
content: "确认取消订单?",
success: function(e) {
e.confirm && t._post_form("user.order/cancel", {
order_id: r
}, function(t) {
a.getOrderList(a.data.dataType);
});
}
});
},
receipt: function(e) {
var a = this, r = e.currentTarget.dataset.id;
wx.showModal({
title: "提示",
content: "确认收到商品?",
success: function(e) {
e.confirm && t._post_form("user.order/receipt", {
order_id: r
}, function(t) {
a.getOrderList(a.data.dataType);
});
}
});
},
detail: function(t) {
var e = t.currentTarget.dataset.id;
wx.navigateTo({
url: "../aftermarket/create?order_goods_id=" + e
});
},
orderDetail: function(t) {
var e = t.currentTarget.dataset.id;
wx.navigateTo({
url: "../order/detail?order_id=" + e
});
},
onPullDownRefresh: function() {
wx.stopPullDownRefresh();
}
});

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "售后订单",
"usingComponents": {}
}

View File

@@ -0,0 +1,78 @@
<view class="container m-b5">
<view class="goods-detail-box">
<view class="header f-28 col-3">
<view catchtap="bindHeaderTap" class="{{dataType==='all'?'active':''}}" data-type="all">全部售后</view>
<view bindtap="bindHeaderTap" class="{{dataType==='apply'?'active':''}}" data-type="apply">已申请</view>
<view bindtap="bindHeaderTap" class="{{dataType==='complete'?'active':''}}" data-type="complete">已完成</view>
</view>
<scroll-view scrollY="{{true}}">
<view class="wrapper">
<view wx:if="{{data.length}}">
<view class="m-top20 " wx:for="{{data}}" wx:key="this">
<view class="order-box b-f">
<view class="order-header dis-flex">
<view class="flex-box t-l">
<text class="title">商品信息</text>
</view>
<view class="flex-box t-r">
<text class="cont" wx:if="{{item.refund_status==2}}">已完成</text>
<text class="cont" wx:if="{{item.refund_status==1}}">已申请</text>
</view>
</view>
</view>
<view class="order-box b-f">
<view class="order-cont dis-flex">
<view class="order-num">
<text>退款单号:{{item.refund_no}}</text>
</view>
<view class="order-time">
<text>{{item.create_time}}</text>
</view>
</view>
</view>
<view class="order-box order-img_list">
<view class="order-shop">
<view bindtap="detail" class="order-list-box dis-flex" data-id="{{item.order_goods_id}}">
<view class="left">
<view class="dis-flex">
<view class="order-shop-left">
<image src="{{item.image.file_path}}"></image>
</view>
</view>
</view>
<view class="right p-r">
<text class="goods-number">共1件</text>
<text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
</view>
</view>
</view>
</view>
<view class="order-box b-f">
<view class="order-btn dis-flex">
<view class="order-left">
<view class="text">
<text>申请时间:</text>
<text class="">{{item.aftermarket_apply_date}}</text>
</view>
</view>
<view class="order-right">
<view class="dis-flex">
<view class="flex-box">
<view bindtap="orderDetail" class="btn-main" data-id="{{item.order_id}}">订单详情</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view wx:else>
<view class="yoshop-notcont">
<text class="iconfont icon-ziyuan"></text>
<text class="cont">亲,您还没有售后信息哦!</text>
</view>
</view>
</view>
</scroll-view>
</view>
</view>

View File

@@ -0,0 +1,151 @@
.header {
background: #fff;
border-bottom: 1rpx solid #e4e4e4;
display: flex;
height: 44px;
line-height: 44px;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
.header view {
flex: 1;
text-align: center;
}
.header .active {
color: #fd4a5f;
}
.wrapper {
margin-top: 54px;
}
.order-box {
padding: 0 15px;
}
.order-header {
padding-top: 10rpx;
}
.order-header .title {
color: #333;
font-size: 30rpx;
}
.order-header .cont {
color: #fd4a5f;
font-size: 30rpx;
}
.order-cont {
justify-content: space-between;
padding: 15rpx 0;
}
.order-cont .order-num text,.order-cont .order-time text {
color: #777;
font-size: 26rpx;
}
.order-shop {
padding: 16rpx 0;
}
.order-shop-left,.order-shop-left image {
background: #fff;
display: inline-block;
height: 160rpx;
margin-right: 15rpx;
width: 160rpx;
}
.order-shop .num {
float: right;
}
.order-btn {
padding: 18rpx 0;
}
.order-btn .order-left {
flex: 3;
}
.order-btn .order-left .text,.order-btn .order-left text {
font-size: 30rpx;
}
.order-btn .order-left .text {
color: #777;
}
.order-btn .order-right {
flex: 1.5;
}
.order-list-box .left {
flex: 4;
overflow: hidden;
position: relative;
}
.order-list-box .right {
flex: 1;
}
.goods-number {
color: #777;
font-size: 28rpx;
position: absolute;
right: 12px;
top: 35%;
}
.btn-default {
border: 1rpx solid #ccc;
border-radius: 4px;
color: #555;
}
.btn-default,.btn-main {
float: right;
font-size: 28rpx;
padding: 6rpx 20rpx;
}
.btn-main {
border: 1rpx solid #fd4a5f;
border-radius: 4px;
color: #fd4a5f;
margin-left: 10rpx;
}
.user-orderJtou {
color: #888;
font-size: 24rpx;
margin-top: -20rpx;
position: absolute;
right: 0;
top: 50%;
}
.order-img_list {
background: #fff;
border-bottom: 1rpx solid #f1f1f1;
border-top: 1rpx solid #f1f1f1;
}
.order-right-name {
color: #555;
font-size: 30rpx;
left: 180rpx;
line-height: 1.6;
margin-top: -46rpx;
position: absolute;
top: 50%;
width: 100%;
}

View File

@@ -0,0 +1,85 @@
var t = getApp();
Page({
data: {
searchColor: "rgba(0,0,0,0.4)",
searchSize: "15",
searchName: "搜索商品",
scrollHeight: 0,
curIndex: -1,
curCateId: 0,
categoryList: [],
goodsList: [],
noMore: !1,
isLoading: !0,
page: 1
},
onLoad: function() {
this.setListHeight(), this.getCategoryList();
},
onShow: function() {},
setListHeight: function() {
var t = this;
wx.getSystemInfo({
success: function(a) {
t.setData({
scrollHeight: a.windowHeight - 47
});
}
});
},
getCategoryList: function() {
var a = this;
t._get("category/index", {}, function(t) {
var o = t.data;
a.setData({
categoryList: o.categoryList,
goodsList: o.goodsList
});
});
},
getGoodsList: function(a, o) {
var s = this;
t._get("goods/lists", {
page: o || 1,
category_id: s.data.curCateId
}, function(t) {
var o = t.data.list, e = s.data.goodsList;
1 == a ? s.setData({
"goodsList.data": e.data.concat(o.data),
isLoading: !1
}) : s.setData({
goodsList: o,
isLoading: !1
});
});
},
onTargetGoods: function(t) {
wx.navigateTo({
url: "../goods/index?goods_id=" + t.detail.target.dataset.id
});
},
onSelectNav: function(t) {
var a = t.currentTarget.dataset.index;
this.setData({
curIndex: a,
curCateId: a > -1 ? this.data.categoryList[a].category_id : 0,
goodsList: [],
page: 1,
noMore: !1,
isLoading: !0
}), this.getGoodsList();
},
onDownLoad: function() {
if (this.data.page >= this.data.goodsList.last_page) return this.setData({
noMore: !0
}), !1;
this.getGoodsList(!0, ++this.data.page);
},
onShareAppMessage: function() {
return {
title: "全部商品",
path: "/pages/category/index"
};
}
});

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "全部商品",
"usingComponents": {}
}

View File

@@ -0,0 +1,53 @@
<view class="container">
<view class="index-search-box">
<navigator class="index-search" hoverClass="none" openType="navigate" url="../search/index">
<view class="index-cont-search t-c">
<icon class="text-center" color="{{searchColor}}" size="{{searchSize}}" type="search"></icon>
<text>{{searchName}}</text>
</view>
</navigator>
</view>
<view class="cate-content dis-flex">
<scroll-view class="cate-left f-28" scrollY="{{true}}" style="height: {{scrollHeight}}px; ">
<text catchtap="onSelectNav" class="type-nav {{curIndex==-1?'selected':''}}" data-index="-1">全部</text>
<text catchtap="onSelectNav" class="type-nav {{curIndex==index?'selected':''}} onelist-hidden" data-index="{{index}}" wx:for="{{categoryList}}" wx:key="cateLeft">{{item.name}}</text>
</scroll-view>
<scroll-view bindscrolltolower="onDownLoad" class="cate-right b-f" scrollTop="{{scrollTop}}" scrollY="true" style="height: {{scrollHeight}}px; ">
<view class="goods-item" wx:for="{{goodsList.data}}" wx:key="this">
<form bindsubmit="onTargetGoods" reportSubmit="true">
<button class="btn-normal" data-id="{{item.goods_id}}" formType="submit">
<view class="goods-item_detail dis-flex">
<view class="goods-item_left">
<image src="{{item.goods_image}}"></image>
</view>
<view class="goods-item_right">
<view class="goods-item_title twolist-hidden">
<text>{{item.goods_name}}</text>
</view>
<view class="goods-item_desc">
<view class="desc-selling_point dis-flex">
<text class="onelist-hidden">{{item.selling_point}}</text>
</view>
<view class="desc-goods_sales onelist-hidden dis-flex">
<text>已售{{item.goods_sales}}件</text>
</view>
<view class="desc_footer">
<text class="price_x">¥{{item.goods_sku.goods_price}}</text>
<text class="price_y col-9">¥{{item.goods_sku.line_price}}</text>
</view>
</view>
</view>
</view>
</button>
</form>
</view>
<view class="no-more f-30" wx:if="{{noMore}}">亲, 没有更多了</view>
<view wx:if="{{!isLoading&&!goodsList.data.length}}">
<view class="yoshop-notcont">
<text class="iconfont icon-ziyuan"></text>
<text class="cont">亲,此处暂无商品哦</text>
</view>
</view>
</scroll-view>
</view>
</view>

View File

@@ -0,0 +1,132 @@
.index-search-box {
background: #fff;
padding: 13rpx 13rpx 18rpx;
}
.index-search {
border-bottom: 0;
border-radius: 50rpx;
box-sizing: border-box;
color: #999;
font-size: 28rpx;
height: 64rpx;
line-height: 64rpx;
overflow: hidden;
position: relative;
}
.index-search,page {
background: #fff;
}
.no-more {
font-size: 28rpx;
padding-top: 0;
}
.cate-content {
background: #fff;
width: 100%;
}
.cate-left {
background: #f8f8f8;
color: #444;
display: flex;
flex-direction: column;
height: 100%;
width: 22.2222%;
}
.cate-left .type-nav {
display: block;
font-size: 26rpx;
height: 90rpx;
line-height: 90rpx;
position: relative;
text-align: center;
z-index: 10;
}
.cate-left .type-nav.selected {
background: #fff;
border-right: none;
color: #ff495e;
font-size: 28rpx;
}
.cate-right {
width: 77.7778%;
}
.goods-item {
background: #fff;
box-sizing: border-box;
margin-bottom: 10rpx;
padding: 16rpx;
width: 100%;
}
.goods-item text {
line-height: 1.6;
}
.goods-item:last-child {
margin-bottom: 0;
}
.goods-item_left {
align-items: center;
background: #fff;
display: flex;
width: 36%;
}
.goods-item_left image {
display: block;
height: 190rpx;
width: 190rpx;
}
.goods-item_right {
padding-left: 20rpx;
position: relative;
width: 60%;
}
.goods-item_right .goods-item_title {
color: #333;
font-size: 26rpx;
height: 72rpx;
margin-top: 20rpx;
}
.goods-item_right .goods-item_title text {
line-height: 1.3;
}
.goods-item_desc {
margin-top: 8rpx;
}
.desc-selling_point {
color: #ff495e;
font-size: 24rpx;
width: 100%;
}
.desc-goods_sales {
color: #999;
font-size: 24rpx;
}
.desc_footer .price_x {
color: #f03c3c;
font-size: 27rpx;
margin-right: 16rpx;
}
.desc_footer .price_y {
font-size: 24rpx;
text-decoration: line-through;
}

View File

@@ -0,0 +1,90 @@
var t = getApp();
Page({
data: {
searchColor: "rgba(0,0,0,0.4)",
searchSize: "15",
searchName: "搜索商品",
scrollHeight: null,
showView: !1,
arrange: "",
sortType: "all",
sortPrice: !1,
option: {},
list: {},
noList: !0,
no_more: !1,
page: 1
},
onLoad: function(t) {
var a = this;
a.setListHeight(), a.setData({
option: t
}, function() {
a.getGoodsList(!0);
});
},
getGoodsList: function(a, e) {
var s = this;
t._get("goods/lists", {
page: e || 1,
sortType: s.data.sortType,
sortPrice: s.data.sortPrice ? 1 : 0,
category_id: s.data.option.category_id || 0,
search: s.data.option.search || ""
}, function(t) {
var e = t.data.list, i = s.data.list;
!0 === a || void 0 === i.data ? s.setData({
list: e,
noList: !1
}) : s.setData({
"list.data": i.data.concat(e.data)
});
});
},
setListHeight: function() {
var t = this;
wx.getSystemInfo({
success: function(a) {
t.setData({
scrollHeight: a.windowHeight - 90
});
}
});
},
switchSortType: function(t) {
var a = this, e = t.currentTarget.dataset.type, s = "price" !== e || !a.data.sortPrice;
a.setData({
list: {},
page: 1,
sortType: e,
sortPrice: s
}, function() {
a.getGoodsList(!0);
});
},
toSynthesize: function(t) {
wx.navigateTo({
url: "../category/screen?objectId="
});
},
onChangeShowState: function() {
this.setData({
showView: !this.data.showView,
arrange: this.data.arrange ? "" : "arrange"
});
},
bindDownLoad: function() {
if (this.data.page >= this.data.list.last_page) return this.setData({
no_more: !0
}), !1;
this.getGoodsList(!1, ++this.data.page);
},
onShareAppMessage: function() {
return {
title: "全部分类",
desc: "",
path: "/pages/category/index"
};
}
});

View File

@@ -0,0 +1,5 @@
{
"navigationBarTitleText": "商品列表",
"enablePullDownRefresh": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,56 @@
<view class="container">
<view class="list-header">
<view class="index-search-box dis-flex" style="position:static">
<navigator class="index-search flex-box" hoverClass="none" openType="navigate" url="../search/index">
<view class="index-cont-search">
<icon class="text-center" color="rgba(0,0,0,0.4)" size="15" type="search"></icon>
<text>搜索商品</text>
</view>
</navigator>
<view bindtap="onChangeShowState" class="list-right f-28">
<text class="iconfont icon-tubiao_kuaizhuangpailie" wx:if="{{showView}}"></text>
<text class="iconfont icon-tubiao_liebiaopailie" wx:else></text>
</view>
</view>
<view class="store_nav_cont dis-flex b-f b-b">
<view bindtap="switchSortType" class="flex-box t-c p-r" data-index="0 " data-type="all" id="list-{{sortType==='all'?true:0}}">
<text>综合</text>
</view>
<view bindtap="switchSortType" class="flex-box t-c p-r" data-index="1" data-type="sales" id="list-{{sortType==='sales'?true:0}}">
<text> 销量</text>
</view>
<view bindtap="switchSortType" class="flex-box t-c p-r" data-index="2" data-type="price" id="list-{{sortType==='price'?true:0}}">
<text class="price"> 价格</text>
<text class="iconfont icon-jiantou-copy tf-180 top_jiantou {{sortPrice?'':'active'}}"></text>
<text class="iconfont icon-jiantou-copy bot_jiantou {{sortPrice?'active':''}}"></text>
</view>
</view>
<scroll-view bindscrolltolower="bindDownLoad" class="weui-panel weui-panel_access" scrollY="true" style="height: {{scrollHeight}}px; width: 750rpx;" wx:if="{{list.data.length>0}}">
<view class="new">
<view class="category-list {{arrange}}">
<navigator class="list b-f" hoverClass="none" url="../goods/index?goods_id={{item.goods_id}}" wx:for="{{list.data}}" wx:key="list">
<view class="left">
<view class="img">
<image class="goodsImg" mode="scaleToFill" src="{{item.image[0].file_path}}"></image>
</view>
</view>
<view class="right">
<view class="cont">
<text class="f-28 title twolist-hidden m-top10">{{item.goods_name}}</text>
<view class="price f-30 col-m"> ¥{{item.goods_min_price}} <text class="del f-22" wx:if="{{item.goods_sku.line_price>0}}">{{item.goods_sku.line_price}}</text>
</view>
</view>
</view>
</navigator>
</view>
</view>
<view class="no-more f-30" hidden="{{!no_more}}">亲, 没有更多了</view>
</scroll-view>
</view>
<view class="yoshop-notcont" style="margin-top:130px;" wx:if="{{!noList&&!list.data.length}}">
<view class="img">
<image mode="aspectFit" src="../../images/no_content.png"></image>
</view>
<text class="cont">亲, 没有相关内容</text>
</view>
</view>

View File

@@ -0,0 +1,159 @@
.store_nav_cont {
padding: 10px 0;
}
.store_nav_cont #list-true {
color: #ff495e;
font-size: 28rpx;
}
.store_nav_cont #list-0 {
color: #333;
font-size: 28rpx;
}
.store_nav_cont #list-0 .icon-fenlei {
color: #777;
font-size: 28rpx;
padding-left: 8rpx;
}
.store_nav_cont #list-true .icon-fenlei {
color: #ff495e;
font-size: 28rpx;
padding-left: 8rpx;
}
.store_nav_cont .price {
padding-right: 30rpx;
}
.store_nav_cont #list-0 .top_jiantou,.store_nav_cont #list-true .top_jiantou {
color: #777;
font-size: 18rpx;
margin-top: -16rpx;
position: absolute;
right: 52rpx;
top: 50%;
}
.store_nav_cont #list-0 .bot_jiantou,.store_nav_cont #list-true .bot_jiantou {
color: #777;
font-size: 18rpx;
margin-top: -2rpx;
position: absolute;
right: 52rpx;
top: 50%;
}
.store_nav_cont #list-true .bot_jiantou.active,.store_nav_cont #list-true .top_jiantou.active {
color: #ff495e;
}
.container {
position: relative;
}
.cate-btn {
background: #ff495e;
bottom: 18rpx;
color: #fff;
font-size: 20rpx;
padding: 4px 18rpx;
right: 18rpx;
}
.index-cont-search icon {
left: 0;
margin-left: 20rpx;
}
.index-search-box {
background: #fff;
border-bottom: 1px solid #eee;
left: 0rpx;
padding: 18rpx 13rpx;
position: fixed;
right: 0rpx;
top: 1rpx;
z-index: 999;
}
.index-search {
background: #fff;
border-bottom: 0;
border-radius: 50rpx;
box-sizing: border-box;
color: #999;
font-size: 32rpx;
height: 64rpx;
line-height: 64rpx;
margin: 0 10rpx;
overflow: hidden;
position: relative;
}
.list-right {
width: 60rpx;
}
.list-right text {
font-size: 40rpx;
height: 60rpx;
line-height: 60rpx;
}
.list-header {
left: 0;
position: fixed;
right: 0;
top: 1rpx;
}
.no-more {
color: #737373;
margin: 10px 0;
text-align: center;
}
.category-list {
overflow: hidden;
}
.category-list .list {
box-sizing: border-box;
float: left;
width: 50%;
}
.category-list .list:nth-child(2n) {
border-bottom: 4px solid #f7f7f7;
border-left: 2px solid #f7f7f7;
}
.category-list .list:nth-child(2n-1) {
border-bottom: 4px solid #f7f7f7;
border-right: 2px solid #f7f7f7;
}
.category-list.arrange .list {
border-bottom: 1rpx solid #f7f7f7;
overflow: hidden;
padding: 15rpx;
width: 100%;
}
.category-list.arrange .list .left {
float: left;
width: 35%;
}
.category-list.arrange .list .right {
float: left;
width: 65%;
}
.category-list.arrange .list .left .img image {
height: 220rpx;
width: 220rpx;
}

View File

@@ -0,0 +1,84 @@
var o = getApp();
Page({
data: {
nav_select: !1,
options: {},
address: null,
exist_address: !1,
goods: {},
disabled: !1,
hasError: !1,
error: "",
utype: 0
},
onLoad: function(o) {
this.data.options = o, console.log(o), this.getUserDetail();
},
onShow: function() {
this.getOrderData(), this.getUserDetail();
},
getUserDetail: function() {
var r = this;
o._get("user.index/detail", {}, function(o) {
console.log(o), r.setData({
utype: o.data.userInfo.utype
});
});
},
getOrderData: function() {
var r = this, t = r.data.options, e = function(t) {
if (1 !== t.code) return o.showError(t.msg), !1;
t.data.has_error ? (r.data.hasError = !0, r.data.error = t.data.error_msg, o.showError(r.data.error)) : (r.data.hasError = !1,
r.data.error = ""), r.setData(t.data);
};
"buyNow" === t.order_type ? o._get("order/buyNow", {
goods_id: t.goods_id,
goods_num: t.goods_num,
goods_sku_id: t.goods_sku_id
}, function(o) {
e(o);
}) : "cart" === t.order_type && o._get("order/cart", {}, function(o) {
e(o);
});
},
selectAddress: function() {
wx.navigateTo({
url: "../address/" + (this.data.exist_address ? "index?from=flow" : "create")
});
},
submitOrder: function() {
var r = this, t = r.data.options;
if (r.data.disabled) return !1;
if (r.data.hasError) return o.showError(r.data.error), !1;
var e = function(r) {
if (-10 === r.code) return o.showError(r.msg, function() {
wx.redirectTo({
url: "../pays/pays"
});
}), !1;
wx.redirectTo({
url: "../pays/pays"
});
};
r.data.disabled = !0, wx.showLoading({
title: "正在处理..."
}), "buyNow" === t.order_type ? o._post_form("order/buyNow", {
goods_id: t.goods_id,
goods_num: t.goods_num,
goods_sku_id: t.goods_sku_id
}, function(o) {
console.log("success"), e(o);
}, function(o) {
console.log("fail");
}, function() {
console.log("complete"), r.data.disabled = !1;
}) : "cart" === t.order_type && o._post_form("order/cart", {}, function(o) {
console.log("success"), e(o);
}, function(o) {
console.log("fail");
}, function() {
console.log("complete"), r.data.disabled = !1;
});
}
});

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "订单确认",
"usingComponents": {}
}

View File

@@ -0,0 +1,76 @@
<view class="container p-bottom">
<view catchtap="selectAddress">
<view wx:if="{{address.address_id}}">
<view class="b-f">
<view class="flow-checkout-header">
<text class="iconfont icon-dingwei1"></text>
<view class="flow-header-left">
<view class="flow-checkout-admin f-30 col-3">
<text>{{address.name}}</text>
<text>{{address.phone}}</text>
<text class="col-m"></text>
</view>
<view class="flow-checkout-address"> {{address.region.province}} {{address.region.city}} {{address.region.region}} {{address.detail}} </view>
</view>
<view class="flow-header-right pr-12">
<text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
</view>
</view>
</view>
</view>
<view wx:else>
<view class="flow-checkout-header">
<text class="iconfont icon-dingwei1"></text>
<view class="flow-header-left">
<view class="f-28 col-6">去选择配送地址 </view>
</view>
<view class="flow-header-right p-r15">
<text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
</view>
</view>
</view>
</view>
<view class="m-top20">
<view class="checkout_list " wx:for="{{goods_list}}" wx:key="this">
<navigator url="../goods/index?goods_id={{item.goods_id}}">
<view class="dis-flex flow-shopList" data-index="{{index}}">
<view class="flow-list-left">
<image mode="scaleToFill" src="{{item.image[0].file_path}}"></image>
</view>
<view class="flow-list-right">
<text class="f-30 col-3 twolist-hidden">{{item.goods_name}}</text>
<text class="f-26 col-7">{{item.goods_sku.goods_attr}}</text>
<view class="flow-list-cont">
<text class="flow-cont" wx:if="{{utype==1}}">¥{{item.goods_price}}</text>
<text class="flow-cont" wx:elif="{{utype==2}}">¥{{item.l_a}}</text>
<text class="flow-cont" wx:elif="{{utype==3}}">¥{{item.l_b}}</text>
<text class="small">×{{item.total_num}}</text>
</view>
</view>
</view>
</navigator>
</view>
<view class="flow-num-box b-f padding-box">
<text>共{{order_total_num}}件商品,合计:</text>
<text class="flow-money col-m">¥{{order_total_price}}</text>
</view>
</view>
<view class="flow-all-money b-f padding-box m-top20">
<view class="dis-flex flow-all-list">
<text class="flex-five">商品总金额:</text>
<view class="flex-five t-r">
<text class="col-m">¥{{order_total_price}}</text>
</view>
</view>
</view>
<view class="flow-fixed-footer b-f m-top10">
<view class="dis-flex chackout-box">
<view class=" chackout-left pl-12 ">实付款: <text class="col-m">¥{{order_pay_price}}</text>
</view>
<view bindtap="submitOrder" class="chackout-right">
<text class="flow-btn">提交订单</text>
</view>
</view>
</view>
<shortcut></shortcut>
</view>

View File

@@ -0,0 +1,18 @@
.checkout_list {
background: #fff;
border-bottom: 1rpx solid #eee;
padding: 10px 15px 2px;
}
.checkout_list .flow-shopList {
border-bottom: 1rpx solid #eee;
padding: 5rpx 0 10rpx;
}
.checkout_list .flow-shopList:last-child {
border-bottom: 0;
}
.flow-header-left {
padding-left: 90rpx;
}

View File

@@ -0,0 +1,119 @@
var t = require("../../@babel/runtime/helpers/defineProperty"), o = getApp();
Page({
data: {
goods_list: [],
order_total_num: 0,
order_total_price: 0,
colourList: [],
colour_id: 0,
hideNotice: !1,
storeInfo: {},
utype: 0
},
onLoad: function(t) {
this.getColourList(), this.getStoreInfo(), this.getUserDetail();
},
onShow: function() {
this.setData({
isLogin: o.checkIsLogin()
}), this.data.isLogin && (this.getCartList(), this.getUserDetail());
},
getUserDetail: function() {
var t = this;
o._get("user.index/detail", {}, function(o) {
console.log(o), t.setData({
utype: o.data.userInfo.utype
});
});
},
getStoreInfo: function() {
var t = this;
o._get("index/getStoreInfo", {}, function(o) {
var e = o.data;
console.log(e), t.setData({
storeInfo: e.store
});
});
},
switchNotice: function() {
this.setData({
hideNotice: !0
});
},
getCartList: function() {
var t = this;
o._get("cart/lists", {}, function(o) {
t.setData(o.data);
});
},
getColourList: function() {
var t = this;
o._get("goods/getColourList", {}, function(o) {
var e = o.data;
t.setData({
colourList: e.list
});
});
},
addCount: function(e) {
var a = this, i = e.currentTarget.dataset.index, s = e.currentTarget.dataset.skuId, r = a.data.goods_list[i], n = a.data.order_total_price;
wx.showLoading({
title: "加载中",
mask: !0
}), o._post_form("cart/add", {
goods_id: r.goods_id,
goods_num: 1,
goods_sku_id: s
}, function() {
var o;
r.total_num++, a.setData((t(o = {}, "goods_list[" + i + "]", r), t(o, "order_total_price", a.mathadd(n, r.goods_price)),
o));
});
},
minusCount: function(e) {
var a = this, i = e.currentTarget.dataset.index, s = e.currentTarget.dataset.skuId, r = a.data.goods_list[i], n = a.data.order_total_price;
r.total_num > 1 && (wx.showLoading({
title: "加载中",
mask: !0
}), o._post_form("cart/sub", {
goods_id: r.goods_id,
goods_sku_id: s
}, function() {
var o;
r.total_num--, r.total_num > 0 && a.setData((t(o = {}, "goods_list[" + i + "]", r),
t(o, "order_total_price", a.mathsub(n, r.goods_price)), o));
}));
},
del: function(t) {
var e = this, a = t.currentTarget.dataset.goodsId, i = t.currentTarget.dataset.skuId;
wx.showModal({
title: "提示",
content: "您确定要移除当前商品吗?",
success: function(t) {
t.confirm && o._post_form("cart/delete", {
goods_id: a,
goods_sku_id: i
}, function(t) {
e.getCartList();
});
}
});
},
submit: function(t) {
wx.navigateTo({
url: "../flow/checkout?order_type=cart"
});
},
mathadd: function(t, o) {
return (Number(t) + Number(o)).toFixed(2);
},
mathsub: function(t, o) {
return (Number(t) - Number(o)).toFixed(2);
},
goShopping: function() {
wx.switchTab({
url: "../index/index"
});
}
});

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "购物车",
"usingComponents": {}
}

View File

@@ -0,0 +1,58 @@
<view class="container p-bottom">
<view class="notice-wrap" hidden="{{hideNotice}}" wx:if="{{storeInfo.cart_notice.length>0}}">
<view class="tongzhitext">
<text class="tongzhi-text">{{storeInfo.cart_notice}}</text>
</view>   <view bindtap="switchNotice" class="closeView">x</view>
</view>
<view class="flow-list">
<view wx:if="{{goods_list.length}}">
<view wx:for="{{goods_list}}" wx:key="this">
<view class="dish-item" data-index="{{index}}" style="{{item.txtStyle}}">
<view class="dish-item-wrp">
<navigator hoverClass="none" url="../goods/index?goods_id={{item.goods_id}}">
<view class="dish-item-pic">
<image class="image" src="{{item.image[0].file_path}}"></image>
</view>
</navigator>
<view class="dish-item-info">
<navigator hoverClass="none" url="../goods/index?goods_id={{item.goods_id}}">
<view class="goods-name">
<text class="twolist-hidden f-30 col-3">
<text class="colour-box f-20" wx:if="{{item.colour>0}}">{{colourList[item.colour]}}</text>{{item.goods_name}}</text>
<view class="f-26" style="color: #555;"> {{item.goods_title.length>0?item.goods_title:' '}} </view>
</view>
<view class="goods-attr">
<text class="col-7 f-24">{{item.goods_sku.goods_attr}}</text>
</view>
<view class="price f-30 col-m" wx:if="{{utype==1}}"> ¥{{item.goods_price}} <text class="del f-22" wx:if="{{item.goods_sku.line_price>0}}">{{item.goods_sku.line_price}}</text>
</view>
<view class="price f-30 col-m" wx:elif="{{utype==2}}"> ¥{{item.l_a}} <text class="del f-22" wx:if="{{item.goods_sku.line_price>0}}">{{item.goods_sku.line_price}}</text>
</view>
<view class="price f-30 col-m" wx:elif="{{utype==3}}"> ¥{{item.l_b}} <text class="del f-22" wx:if="{{item.goods_sku.line_price>0}}">{{item.goods_sku.line_price}}</text>
</view>
</navigator>
<view catchtap="del" class="flow-dete" data-goods-id="{{item.goods_id}}" data-sku-id="{{item.goods_sku_id}}">
<text class="iconfont icon-lajixiang"></text>
</view>
</view>
</view>
</view>
</view>
<view class="cart-tab-wrp">
<view class="cart-item-total cart-tab-item">
<text class="cart-item-total-price h4">合计:¥{{order_total_price}}</text>
</view>
<view class="cart-tab-item">
<view bindtap="submit" class="cart-tab-item-btn h4">去结算</view>
</view>
</view>
</view>
<view wx:else>
<view class="yoshop-notcont">
<text class="iconfont icon-ziyuan"></text>
<text class="cont">亲,购物车还没有商品哦</text>
<view bindtap="goShopping" class="flow-btn-min">去逛逛</view>
</view>
</view>
</view>
</view>

View File

@@ -0,0 +1,457 @@
.wxParse {
color: #666;
font-family: Helvetica,sans-serif;
font-size: 28rpx;
line-height: 1.8;
margin: 0 5px;
}
view {
overflow: auto;
word-break: break-all;
}
.wxParse-inline {
display: inline;
}
.wxParse-div,.wxParse-inline {
margin: 0;
padding: 0;
}
.wxParse-h1 {
font-size: 2em;
margin: .67em 0;
}
.wxParse-h2 {
font-size: 1.5em;
margin: .75em 0;
}
.wxParse-h3 {
font-size: 1.17em;
margin: .83em 0;
}
.wxParse-h4 {
margin: 1.12em 0;
}
.wxParse-h5 {
font-size: .83em;
margin: 1.5em 0;
}
.wxParse-h6 {
font-size: .75em;
margin: 1.67em 0;
}
.wxParse-h1 {
font-size: 18px;
font-weight: 400;
margin-bottom: .9em;
}
.wxParse-h2 {
font-size: 16px;
}
.wxParse-h2,.wxParse-h3 {
font-weight: 400;
margin-bottom: .34em;
}
.wxParse-h3 {
font-size: 15px;
}
.wxParse-h4 {
font-size: 14px;
font-weight: 400;
margin-bottom: .24em;
}
.wxParse-h5 {
font-size: 13px;
font-weight: 400;
margin-bottom: .14em;
}
.wxParse-h6 {
font-size: 12px;
font-weight: 400;
margin-bottom: .04em;
}
.wxParse-b,.wxParse-h1,.wxParse-h2,.wxParse-h3,.wxParse-h4,.wxParse-h5,.wxParse-h6,.wxParse-strong {
font-weight: bolder;
}
.wxParse-address,.wxParse-cite,.wxParse-em,.wxParse-i,.wxParse-var {
font-style: italic;
}
.wxParse-code,.wxParse-kbd,.wxParse-pre,.wxParse-samp,.wxParse-tt {
font-family: monospace;
}
.wxParse-pre {
white-space: pre;
}
.wxParse-big {
font-size: 1.17em;
}
.wxParse-small,.wxParse-sub,.wxParse-sup {
font-size: .83em;
}
.wxParse-sub {
vertical-align: sub;
}
.wxParse-sup {
vertical-align: super;
}
.wxParse-del,.wxParse-s,.wxParse-strike {
text-decoration: line-through;
}
.wxParse-s,.wxParse-strong {
display: inline;
}
.wxParse-a {
color: #00bfff;
overflow: auto;
word-break: break-all;
}
.wxParse-video {
margin: 10px 0;
text-align: center;
}
.wxParse-video-video {
width: 100%;
}
.wxParse-img {
background-color: #efefef;
overflow: hidden;
}
.wxParse-blockquote {
background: #f5f5f5;
border-left: 3px solid #dbdbdb;
font-family: Courier,Calibri,宋体;
margin: 0;
padding: 10px 0 10px 5px;
}
.wxParse-code,.wxParse-wxxxcode-style {
background: #f5f5f5;
display: inline;
}
.wxParse-ul {
margin: 20rpx 10rpx;
}
.wxParse-li,.wxParse-li-inner {
align-items: baseline;
display: flex;
margin: 10rpx 0;
}
.wxParse-li-text {
align-items: center;
line-height: 20px;
}
.wxParse-li-circle {
background-color: #333;
display: inline-flex;
height: 5px;
margin-right: 5px;
width: 5px;
}
.wxParse-li-square {
background-color: #333;
}
.wxParse-li-ring,.wxParse-li-square {
display: inline-flex;
height: 10rpx;
margin-right: 5px;
width: 10rpx;
}
.wxParse-li-ring {
background-color: #fff;
border: 2rpx solid #333;
border-radius: 50%;
}
.wxParse-u {
text-decoration: underline;
}
.wxParse-hide {
display: none;
}
.WxEmojiView {
align-items: center;
}
.wxEmoji {
height: 16px;
width: 16px;
}
.wxParse-tr {
border-bottom: 1px solid #e0e0e0;
border-right: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
display: flex;
}
.wxParse-td,.wxParse-th {
border-left: 1px solid #e0e0e0;
flex: 1;
font-size: 28rpx;
padding: 5px;
word-break: break-all;
}
.wxParse-td:last {
border-top: 1px solid #e0e0e0;
}
.wxParse-th {
background: #f0f0f0;
border-top: 1px solid #e0e0e0;
}
.image {
height: 100%;
width: 100%;
}
.cart-tab-item-btn {
background: #ff495e;
color: #fff;
display: block;
float: right;
font-size: 32rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
width: 160rpx;
}
.price {
margin-top: 10rpx;
}
.colour-box {
background: #e64340;
color: #fff;
font-size: 26rpx;
line-height: 26rpx;
margin-right: 10rpx;
padding: 4rpx 8rpx;
text-align: center;
}
.cart-tab-item {
width: 375rpx;
}
.cart-tab-wrp {
background: #fff;
border-top: 1rpx solid #ddd;
bottom: 0rpx;
color: #000;
display: flex;
flex-direction: row;
height: 100rpx;
position: fixed;
width: 100%;
z-index: 10;
}
.cart-tab-item {
line-height: 100rpx;
overflow: hidden;
}
.cart-tab-item .cart-item-total-price {
float: left;
}
.cart-item-total {
padding-left: 30rpx;
}
.cart-item-total-price {
color: #ff495e;
font-size: 32rpx;
text-align: center;
}
.cart-item-total-price em {
display: block;
}
.cart-item-icon-wrp {
height: 90rpx;
position: absolute;
top: -4rpx;
width: 110rpx;
}
.cart-item-icon {
height: 90rpx;
width: 90rpx;
}
.dish-item {
background: #fff;
border-bottom: 1rpx solid #eee;
padding: 26rpx 0;
position: relative;
width: 100%;
}
.dish-item-wrp {
display: flex;
flex-direction: row;
width: 100%;
}
.dish-item-pic {
margin-left: 15px;
width: 100%;
}
.dish-item-pic image {
background: #fff;
border: 1rpx solid #eee;
height: 200rpx;
margin: 0 auto;
width: 200rpx;
}
.dish-item-info {
margin-right: 15px;
padding-left: 16rpx;
width: 68%;
}
.dish-item-sales {
color: #ccc;
font-size: 20rpx;
line-height: 50rpx;
}
.dish-item-money {
color: #ff495e;
font-size: 32rpx;
padding: 0 0 10rpx;
}
.wx-goods_price .dish-item-money {
float: left;
}
.wx-goods_price {
overflow: hidden;
}
.flow-dete {
bottom: 25rpx;
position: absolute;
right: 30rpx;
}
.flow-dete .icon-lajixiang {
color: #777;
font-size: 34rpx;
}
.flow-btn-min {
background: #fff;
border: 1rpx solid #ccc;
border-radius: 5px;
color: #777;
font-size: 28rpx;
height: 30px;
line-height: 30px;
margin: 25rpx auto 0;
text-align: center;
width: 200rpx;
}
@-webkit-keyframes remindMessage {
0% {
-webkit-transform: translateX(90%);
}
100% {
-webkit-transform: translateX(-180%);
}
}
@keyframes remindMessage {
0% {
-webkit-transform: translateX(90%);
}
100% {
-webkit-transform: translateX(-180%);
}
}
.tongzhitext {
margin-left: 10rpx;
margin-right: 80rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tongzhi-text {
animation: remindMessage 14s linear infinite;
display: block;
}
.notice-wrap,.tongzhi-text {
color: #d09868;
font-size: 28rpx;
width: 100%;
}
.notice-wrap {
background: #ffebda;
height: 60rpx;
line-height: 60rpx;
}
.closeView {
font-size: 35rpx;
height: 45rpx;
line-height: 45rpx;
position: absolute;
right: 20rpx;
text-align: center;
top: 5rpx;
width: 45rpx;
}

View File

@@ -0,0 +1,201 @@
require("../../@babel/runtime/helpers/Arrayincludes");
var a = getApp(), t = require("../../wxParse/wxParse.js");
Page({
data: {
imgList: [],
goodsNo: null,
fromData: null,
isShangJia: !1,
searchValue: "",
searchGoodsNoArray: [],
imageObjArray: [],
imageUrlArray: [],
cateObjArray: [],
indexCate: null,
colourObjList: [],
indexColour: null
},
bindPickerChangeCate: function(a) {
var t = this.data.fromData;
t.category_id = this.data.cateObjArray[a.detail.value].category_id, this.setData({
fromData: t,
indexCate: a.detail.value
});
},
bindPickerChangeColour: function(a) {
var t = this.data.fromData;
t.colour = this.data.colourObjList[a.detail.value].id, this.setData({
fromData: t,
indexColour: a.detail.value
});
},
onLoad: function(a) {
var t = this, o = wx.getStorageSync("values");
wx.getStorage({
key: "phone",
success: function(a) {
"" != a.data && o.includes(a.data) || wx.showModal({
title: "提示",
content: "无权访问",
success: function(a) {
a.confirm, wx.navigateBack({
delta: 1
});
}
}), t.CategoryList(), t.ColourList();
}
});
},
onShow: function() {},
bindFormSubmit: function(t) {
var o = t.detail.value.jieshao, e = t.detail.value.goods_price, s = t.detail.value.l_a, i = t.detail.value.l_b, r = t.detail.value.stock_num;
console.log(r);
var n = this.data.fromData;
if (n.content = o, n.goods_price = e, n.l_b = i, n.l_a = s, n.goods_status = this.data.shangjiastatus,
null != n.colour && null != n.category_id) {
var l = {}, d = {};
l.goods_id = n.goods_id, l.images = n.imageIdList, l.content = o, d.goods_no = this.data.goodsNo,
d.goods_price = e, d.l_b = i, d.l_a = s, d.stock_num = r, l.spec = d, l.colour = n.colour,
l.goods_status = n.goods_status, l.category_id = n.category_id, console.log(l),
wx.request({
url: "https://ltwxminiapp.19year.cn/index.php?s=/api/goods/editGoods&wxapp_id=10001",
header: {
"content-type": "application/json"
},
data: l,
method: "POST",
success: function(t) {
console.log(t.data), 1 == t.data.code ? a.showError("保存成功") : a.showError("保存失败");
}
});
} else a.showError("请选择分类与成色");
},
getSearchContent: function(t) {
var o = this, e = t.detail.value;
console.log(e), a._get("goods/likeGoodsNo", {
goods_no: e
}, function(a) {
console.log(a.data.list), o.setData({
searchGoodsNoArray: a.data.list
});
}), o.setData({
searchValue: e
});
},
clearNo: function() {
this.setData({
searchValue: "",
searchGoodsNoArray: []
});
},
xuanze: function(t) {
var o = t.currentTarget.dataset.goodsId;
if (console.log(t.currentTarget.dataset.goodsId), o.length <= 0) return a.showError("没有选中数据"),
!1;
this.setData({
searchValue: "",
searchGoodsNoArray: []
}), this.getGoodsDetail(o);
},
CategoryList: function() {
var t = this;
a._get("category/lists", {}, function(a) {
var o = a.data;
t.setData({
cateObjArray: o.list
});
});
},
ColourList: function() {
var t = this;
a._get("goods/getColourListV2", {}, function(a) {
var o = a.data;
t.setData({
colourObjList: o.data
});
});
},
onSaoMa: function() {
var t = this;
wx.scanCode({
onlyFromCamera: !0,
scanType: [ "barCode" ],
success: function(a) {
t.getGoodsDetail(a.result);
},
fail: function(t) {
a.showError(t.result + "扫码错误");
}
});
},
getGoodsDetail: function(t) {
var o = this;
a._get("goods/infos", {
goods_no: t
}, function(a) {
var e = o.initGoodsDetailData(a.data);
o.setData(e), o.setData({
goodsNo: t
});
var s = [], i = [];
e.detail.image.forEach(function(a) {
s.push(a.file_path), i.push(a);
}), o.setData({
imageUrlArray: s,
imageObjArray: i
}), console.log(e);
var r = {
imageIdList: []
};
r.goods_price = e.goods_price, r.l_a = e.l_a, r.l_b = e.l_b, r.content = o.delHtmlTag(e.detail.content),
r.goods_id = e.detail.goods_id, console.log(e.detail.category_id), o.setData({
indexCate: null
}), o.data.cateObjArray.forEach(function(a, t) {
a.category_id == e.detail.category_id && (o.setData({
indexCate: t
}), r.category_id = a.category_id);
}), console.log(e.detail.colour), o.setData({
indexColour: null
}), o.data.colourObjList.forEach(function(a, t) {
a.id == parseInt(e.detail.colour) && (o.setData({
indexColour: t
}), r.colour = a.id);
}), 10 == e.detail.goods_status.value ? (r.goods_status = 10, o.setData({
isShangJia: !0,
fromData: r,
shangjiastatus: 10
})) : (r.goods_status = 20, o.setData({
isShangJia: !1,
fromData: r,
shangjiastatus: 20
}));
});
},
initGoodsDetailData: function(a) {
return a.detail.content.length > 0 && t.wxParse("content", "html", a.detail.content, this, 0),
a.goods_sku_id = a.detail.spec[0].spec_sku_id, a.goods_price = a.detail.spec[0].goods_price,
a.l_a = a.detail.spec[0].l_a, a.l_b = a.detail.spec[0].l_b, a.line_price = a.detail.spec[0].line_price,
a.stock_num = a.detail.spec[0].stock_num, a;
},
updateImageList: function(a) {
console.log("update", a);
var t = a.detail.list.map(function(a) {
return a.image_id;
}), o = this.data.fromData;
o.imageIdList = t, console.log(), this.setData({
fromData: o
});
},
delHtmlTag: function(a) {
return a.replace(/<[^>]+>/g, "");
},
shangJiaSwitch: function(a) {
a.detail.value ? this.setData({
shangjiastatus: 10
}) : this.setData({
shangjiastatus: 20
});
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "工作台",
"usingComponents": {
"wxDragImg": "/components/imgDrag/imgDrag"
}
}

View File

@@ -0,0 +1,91 @@
<view class="container">
<view class="cont-box b-f">
<button bindtap="onSaoMa" class="saoma">扫码</button>
</view>
<view class="dis-flex search-input-box flex-box">
<view class="search-input">
<view class="dis-flex search-box">
<view class="left">
<icon color="rgba(180,180,180,1)" size="15" type="search"></icon>
</view>
<view class="right">
<input bindinput="getSearchContent" class="input" placeholder="输入串号搜索" placeholderStyle="color:#aba9a9" type="number" value="{{searchValue}}"></input>
</view>
</view>
</view>
<view class="serch-button">
<button bindtap="clearNo" type="warn"> 清空 </button>
</view>
</view>
<view wx:for="{{searchGoodsNoArray}}" wx:key="this">
<view bindtap="xuanze" data-goods-id="{{item.goods_no}}" style="background: rgb(248, 136, 136); border: 1rpx solid white; padding:10rpx; text-align: center;">
<text style="text-align: center;">{{item.goods_no}}</text>
</view>
</view>
<view class="cont-box b-f" wx:if="{{goodsNo!==null}}">
<view class="goods-title">
<text>名称:{{detail.goods_name}}</text>
</view>
<view class="goods-title">
<text class="title f-26" style="color: red;">价 格:{{goods_price}}</text>
</view>
<view class="goods-title">
<text class="title f-26" style="color: red;">数 量:{{stock_num}}</text>
</view>
<view class="goods-title">
<text class="title f-26 twolist-hidden" style="color: #555;">标 题:{{detail.goods_title.length>0?detail.goods_title:' '}}</text>
</view>
<view class="goods-title">
<text class="title f-26 twolist-hidden" style="color: red;">状 态:{{detail.goods_status.text}}</text>
</view>
<wxDragImg bind:updateImageList="updateImageList" columns="{{3}}" defaultGoodsId="{{fromData.goods_id}}" defaultImgList="{{imageObjArray}}" defaultImgUrlList="{{imageUrlArray}}" gap="{{9}}" maxCount="{{9}}" previewSize="{{100}}" style="margin:5rpx;"></wxDragImg>
<form bindsubmit="bindFormSubmit">
<view class="ipt-wrap" style="display: flex;align-items: center; padding-bottom: 10rpx; border-bottom: 1px solid red; ">
<label class="f-30" for="" style="color: #555;">价格:</label>
<input name="goods_price" placeholder="请输入姓名" type="number" value="{{goods_price}}"></input>
</view>
<view class="ipt-wrap" style="display: flex;align-items: center; padding-bottom: 10rpx; border-bottom: 1px solid red; ">
<label class="f-30" for="" style="color: #555;">分销价格:</label>
<input name="l_a" placeholder="" type="number" value="{{l_a}}"></input>
</view>
<view class="ipt-wrap" style="display: flex;align-items: center; padding-bottom: 10rpx; border-bottom: 1px solid red; ">
<label class="f-30" for="" style="color: #555;">一级分销价格:</label>
<input name="l_b" placeholder="" type="number" value="{{l_b}}"></input>
</view>
<view class="ipt-wrap" style="display: flex;align-items: center; padding-bottom: 10rpx; border-bottom: 1px solid red; ">
<label class="f-30" for="" style="color: #555;">数量:</label>
<input name="stock_num" placeholder="请输入姓名" type="number" value="{{stock_num}}"></input>
</view>
<view class="ipt-wrap" style=" padding-bottom: 10rpx; border-bottom: 1px solid red;">
<label class="f-30" for="" style="color: #555;">商品介绍:</label>
<textarea autoHeight class="f-30" name="jieshao" placeholder="此处填写商品介绍" style=" width: auto; margin-bottom: 10rpx; line-height: 10rpx;" value="{{fromData.content}}"></textarea>
</view>
<view class="ipt-wrap" style=" padding-bottom: 10rpx; border-bottom: 1px solid red;">
<picker bindchange="bindPickerChangeCate" range="{{cateObjArray}}" rangeKey="name" value="{{indexCate}}">
<view class="f-30" style="color: #555;"> 分类:<text style="color: black;">{{cateObjArray[indexCate].name}}</text>
</view>
</picker>
</view>
<view class="ipt-wrap" style=" padding-bottom: 10rpx; border-bottom: 1px solid red;">
<picker bindchange="bindPickerChangeColour" range="{{colourObjList}}" rangeKey="name" value="{{indexColour}}">
<view class="f-30" style="color: #555;"> 成色:<text style="color: black;">{{colourObjList[indexColour].name}}</text>
</view>
</picker>
</view>
<view style="display: flex; align-items: center;justify-content: space-between; padding-bottom: 10rpx; margin-top: 10rpx; border-bottom: 1px solid red;">
<view style="display: flex; align-items: center;">
<label class="f-30" for="" style="color: #555;">是否上架:</label>
</view>
<view class="flex" style="display: flex;">
<switch bindchange="shangJiaSwitch" checked="{{isShangJia}}" class="switch"></switch>
</view>
</view>
<view class="cont-box b-f">
<button class="sub" formType="submit"> 保存 </button>
</view>
</form>
</view>
<view wx:else>
<view class="center-text">请先扫码或根据串号查询商品</view>
</view>
</view>

View File

@@ -0,0 +1,142 @@
.saoma {
align-items: center;
background-color: #f70000;
border-radius: 98rpx;
color: #fff;
display: flex;
flex-direction: row;
justify-content: center;
margin-top: 10rpx;
width: 80%;
}
.search-input-box {
background: #f7f7f7;
height: 64rpx;
margin-right: 10rpx;
width: auto;
}
.search-input {
background: #fff;
border-radius: 5px 0 0 5px;
box-sizing: border-box;
overflow: hidden;
padding-left: 10rpx;
width: 100%;
}
.search-input input {
font-size: 30rpx;
height: 64rpx;
line-height: 64rpx;
}
.serch-button {
box-sizing: border-box;
width: 20%;
}
.serch-button button {
border-radius: 0 5px 5px 0;
font-size: 28rpx;
height: 64rpx;
line-height: 64rpx;
}
.search-cate-box {
height: 70rpx;
}
.search-cate {
position: relative;
top: 30%;
}
.sub {
align-items: center;
background-color: #50f85e;
border-radius: 98rpx;
color: #fff;
display: flex;
flex-direction: row;
justify-content: center;
margin-top: 10rpx;
width: 80%;
}
.ipt-wrap {
line-height: 100rpx;
min-height: 100rpx;
}
.ipt-wrap label {
min-width: 120rpx;
}
.goods-title {
color: #333;
overflow: hidden;
padding: 0 0rpx 0 0;
}
.money-box,.money-box .num {
margin-top: 10rpx;
}
.money-box .num {
color: #ff495e;
font-size: 40rpx;
}
.money-box .del {
TEXT-DECORATION: line-through;
color: #999;
font-size: 24rpx;
margin-left: 6rpx;
}
.center-text {
align-items: center;
justify-content: center;
padding-top: 25rpx;
}
.center-text,.img_box {
display: flex;
}
.img_box {
flex-wrap: wrap;
margin: 20rpx;
width: 100%;
}
.img_item_i {
display: block;
height: 100%;
width: 100%;
}
.add_icon {
display: block;
height: 50%;
width: 50%;
}
.img_item {
border: 1px solid #c0ccda;
height: 210rpx;
margin-bottom: 2%;
margin-right: 2%;
position: relative;
width: 30%;
}
.closeImv {
height: 50rpx;
position: absolute;
right: 0rpx;
top: 0rpx;
width: 50rpx;
}

View File

@@ -0,0 +1,177 @@
var t = require("../../@babel/runtime/helpers/typeof"), o = getApp(), e = require("../../wxParse/wxParse.js");
Page({
data: {
nav_select: !1,
indicatorDots: !0,
autoplay: !0,
interval: 3e3,
duration: 800,
currentIndex: 1,
floorstatus: !1,
showView: !0,
detail: {},
goods_price: 0,
line_price: 0,
stock_num: 0,
goods_num: 1,
goods_sku_id: 0,
cart_total_num: 0,
specData: {},
colourList: [],
colour_id: 0,
storeInfo: {},
notice_image: ""
},
preview: function(t) {
var o = t.currentTarget.dataset.index;
console.log(o);
for (var e = [], a = 0; a < this.data.detail.image.length; a++) {
var s = this.data.detail.image[a];
e.push(s.file_path);
}
console.log(e), console.log(this.data.detail.image), wx.previewImage({
current: e[o],
urls: e
});
},
goods_spec_arr: [],
onLoad: function(t) {
this.data.goods_id = t.goods_id, this.getGoodsDetail(), this.getColourList(), this.getStoreInfo();
},
getColourList: function() {
var t = this;
o._get("goods/getColourList", {}, function(o) {
var e = o.data;
t.setData({
colourList: e.list
});
});
},
getStoreInfo: function() {
var t = this;
o._get("index/getStoreInfo", {}, function(o) {
var e = o.data;
console.log(e), t.setData({
storeInfo: e.store,
notice_image: e.notice_image
});
});
},
getGoodsDetail: function() {
var t = this;
o._get("goods/detail", {
goods_id: t.data.goods_id
}, function(o) {
var e = t.initGoodsDetailData(o.data);
t.setData(e);
});
},
initGoodsDetailData: function(t) {
return t.detail.content.length > 0 && e.wxParse("content", "html", t.detail.content, this, 0),
t.goods_sku_id = t.detail.spec[0].spec_sku_id, t.goods_price = t.detail.spec[0].goods_price,
t.line_price = t.detail.spec[0].line_price, t.stock_num = t.detail.spec[0].stock_num,
20 == t.detail.spec_type && (t.specData = this.initManySpecData(t.specData)), t;
},
initManySpecData: function(t) {
for (var o in t.spec_attr) for (var e in t.spec_attr[o].spec_items) e < 1 && (t.spec_attr[o].spec_items[0].checked = !0,
this.goods_spec_arr[o] = t.spec_attr[o].spec_items[0].item_id);
return t;
},
modelTap: function(t) {
var o = t.currentTarget.dataset.attrIdx, e = t.currentTarget.dataset.itemIdx, a = this.data.specData;
for (var s in a.spec_attr) for (var i in a.spec_attr[s].spec_items) o == s && (a.spec_attr[s].spec_items[i].checked = !1,
e == i && (a.spec_attr[s].spec_items[e].checked = !0, this.goods_spec_arr[s] = a.spec_attr[s].spec_items[e].item_id));
this.setData({
specData: a
}), this.updateSpecGoods();
},
updateSpecGoods: function() {
var o = this.goods_spec_arr.join("_"), e = this.data.specData.spec_list.find(function(t) {
return t.spec_sku_id == o;
});
"object" === t(e) && this.setData({
goods_sku_id: e.spec_sku_id,
goods_price: e.form.goods_price,
line_price: e.form.line_price,
stock_num: e.form.stock_num
});
},
setCurrent: function(t) {
this.setData({
currentIndex: t.detail.current + 1
});
},
onChangeShowState: function() {
console.log(1111), console.log(this.data.showView), this.setData({
showView: this.data.showView
});
},
goTop: function(t) {
this.setData({
scrollTop: 0
});
},
scroll: function(t) {
this.setData({
floorstatus: t.detail.scrollTop > 200
});
},
up: function() {
this.data.goods_num < this.data.stock_num && this.setData({
goods_num: ++this.data.goods_num
});
},
down: function() {
this.data.goods_num > 1 && this.setData({
goods_num: --this.data.goods_num
});
},
flowCart: function() {
wx.switchTab({
url: "../flow/index"
});
},
toIndex: function() {
wx.switchTab({
url: "../index/index"
});
},
submit: function(t) {
var e = this, a = t.currentTarget.dataset.type;
o._post_form("cart/check", {
goods_id: e.data.goods_id,
goods_num: e.data.goods_num,
goods_sku_id: e.data.goods_sku_id
}, function(t) {
if (1 != t.code) return o.showSuccess(t.msg), !1;
"buyNow" === a ? wx.navigateTo({
url: "../flow/checkout?" + o.urlEncode({
order_type: "buyNow",
goods_id: e.data.goods_id,
goods_num: e.data.goods_num,
goods_sku_id: e.data.goods_sku_id
})
}) : "addCart" === a && o._post_form("cart/add", {
goods_id: e.data.goods_id,
goods_num: e.data.goods_num,
goods_sku_id: e.data.goods_sku_id
}, function(t) {
o.showSuccess(t.msg), e.setData(t.data);
});
});
},
onShareAppMessage: function() {
return {
title: this.data.detail.goods_name + " " + this.data.detail.goods_title,
path: "/pages/goods/index?goods_id=" + this.data.goods_id
};
},
onShareTimeline: function(t) {
return {
title: this.data.detail.goods_name + " " + this.data.detail.goods_title,
path: "/pages/goods/index?goods_id=" + this.data.goods_id,
imageUrl: this.data.detail.image[0].file_path
};
}
});

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "商品详情",
"usingComponents": {
"shortcut": "/components/shortcut/shortcut"
}
}

View File

@@ -0,0 +1,101 @@
<import src="../../wxParse/wxParse.wxml"></import>
<scroll-view bindscroll="scroll" scrollTop="{{scrollTop}}" scrollY="true" style="position:absolute; top:0; left:0; right:0; bottom:0;">
<view class="container" wx:if="{{detail.goods_id}}">
<view bindtap="imgPreview">
<swiper autoplay="{{autoplay}}" bindchange="setCurrent" circular="{{true}}" class="banner-box swiper-box" duration="{{duration}}" indicatorDots="{{indicatorDots}}" interval="{{interval}}">
<swiper-item bindtap="preview" data-index="{{index}}" wx:for="{{detail.image}}" wx:key="this">
<image class="slide-image" mode="aspectFill" src="{{item.file_path}}"></image>
</swiper-item>
</swiper>
<view class="number-banner">
<text>{{currentIndex}}</text>
<text>/{{detail.image.length}}</text>
</view>
</view>
<view class="cont-box b-f">
<view class="goods-title ">
<text class="title f-32 twolist-hidden">
<text class="colour-box f-20" wx:if="{{detail.colour>0}}">{{colourList[detail.colour]}}</text>
<text>{{detail.goods_name}}</text>
</text>
</view>
<view class="goods-title ">
<text class="title f-26 twolist-hidden" style="color: #555;">{{detail.goods_title.length>0?detail.goods_title:' '}}</text>
</view>
<view class="money-box">
<text class="num">¥{{goods_price}}</text>
<text class="del" wx:if="{{line_price>0}}">¥{{line_price}}</text>
</view>
<view class="goods-sales-box f-28 dis-flex" wx:if="{{stock_num>1}}">
<text class="flex-box stock">库存:{{stock_num}}</text>
</view>
</view>
<view class="cart" wx:if="{{stock_num>1}}">
<view class="modal_cont_box">
<scroll-view class="goods-list-box" scrollY="true">
<view class="buy_number">
<view class="buyNumber f-26">
<text>购买数量</text>
</view>
<view class="selectNumber">
<button bindtap="down" class="default {{goods_num>1?'':' default-active'}}" type="default">-</button>
<input disabled bindinput="import" type="number" value="{{goods_num}}"></input>
<button bindtap="up" class="default {{goods_num!=stock_num?'':' default-active'}}" type="default">+</button>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="cont-box b-f goods-property-box m-top20" wx:if="{{storeInfo.notice.length>0}}">
<text class="col-3 f-30">{{storeInfo.notice}}</text>
</view>
<view class="cont-box b-f goods-property-box m-top20" wx:if="{{notice_image.length>0}}">
<image src="{{notice_image}}" style="width: 100%;"></image>
</view>
<view class="p-bottom">
<view class="top-nav m-top20 b-f b-b">
<view class="top-nav-bar">
<view bindtap="toOrder" id="top-nav-bar-true">
<span>商品描述</span>
</view>
</view>
</view>
<view class="order" hidden="{{hiddenOrder}}">
<view wx:if="{{detail.content!=''}}">
<view class="b-f goods-detail-box">
<view class="goods-cont-li">
<template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
</view>
</view>
</view>
<view wx:else>
<view class="yoshop-notcont">
<text class="iconfont icon-ziyuan"></text>
<text class="cont">亲,此处暂无详情数据</text>
</view>
</view>
</view>
</view>
<view class="footer-fixed f-30">
<view bindtap="toIndex" class="goods-fixed-icon dis-flex flex-x-center flex-y-center">
<text class="iconfont icon-home"></text>
</view>
<view class="goods-fixed-icon dis-flex flex-x-center flex-y-center">
<button openType="contact" sessionFrom="weapp" size="27" style="opacity: 0;position:absolute;top:0px;left:0px;display:block;width:100%;height:100%;" type="default-light"></button>
<text class="iconfont icon-icon_service"></text>
</view>
<view bindtap="flowCart" class="goods-fixed-icon dis-flex flex-x-center flex-y-center" wx:if="{{stock_num==1}}">
<text class="iconfont icon-cart_b"></text>
<view class="flow_num" wx:if="{{cart_total_num>0}}">
<text class="">{{cart_total_num}}</text>
</view>
</view>
<view bindtap="submit" class="order-number" data-type="addCart" wx:if="{{stock_num==1}}">加入购物车</view>
<view bindtap="submit" class="order-bt" data-type="buyNow"> 立即购买</view>
</view>
</view>
</scroll-view>
<view bindtap="goTop" class="widget-goTop" wx:if="{{floorstatus}}">
<text class="iconfont icon-fanhuidingbu"></text>
</view>
<shortcut></shortcut>

View File

@@ -0,0 +1,330 @@
.slide-image {
background: #fff;
}
.banner-box {
border-bottom: 1rpx solid #e4e4e4;
height: 750rpx;
}
.user-orderJtou {
color: #999;
font-size: 26rpx;
margin-top: -9rpx;
position: absolute;
top: 50%;
}
.goods-title {
color: #333;
overflow: hidden;
padding: 0 0rpx 0 0;
}
.money-box,.money-box .num {
margin-top: 10rpx;
}
.money-box .num {
color: #ff495e;
font-size: 40rpx;
}
.money-box .del {
TEXT-DECORATION: line-through;
color: #999;
font-size: 24rpx;
margin-left: 6rpx;
}
.goods-sales-box {
color: #888;
}
.goods-sales-box .stock {
display: block;
text-align: right;
}
.goods-property-box {
padding: 12px;
position: relative;
}
.goods-property-jianTou {
margin-top: -13rpx;
position: absolute;
right: 0;
top: 50%;
width: 52rpx;
}
.goods-property-jianTou image {
height: 100%;
width: 100%;
}
.modal_cont_box {
border-top: 1rpx solid #eee;
padding: 20rpx 12px;
}
.buy_number {
justify-content: space-between;
}
.buyNumber {
background: #fff;
border-radius: 10rpx;
color: #888;
margin-bottom: 10rpx;
}
.tmall-types.mb20 {
margin-bottom: 20rpx;
}
.tipstxt {
color: #888;
font-size: 28rpx;
margin-bottom: 10rpx;
}
.cartypeitem,.cartypelist {
display: inline-block;
}
.cartypeitem {
background: #f3f2f8;
border: 1rpx solid #f3f2f8;
border-radius: 10rpx;
color: #444;
font-size: 31rpx;
height: 60rpx;
line-height: 60rpx;
margin: 0 20rpx 20rpx 0;
overflow: hidden;
padding: 0 30rpx;
position: relative;
}
.cartypeitem.cur {
background: #ff495e;
border: 1rpx solid #ff495e;
color: #fff;
}
.cartypeitem.cur:after {
bottom: 0;
content: "";
display: inline-block;
height: 16rpx;
position: absolute;
right: 0;
width: 16rpx;
}
.cartypeitem.disabled {
background: #eee;
border: 2rpx dashed #dedede;
color: #dedede;
cursor: not-allowed;
}
.number-banner {
background: rgba(0,0,0,.3);
border-radius: 50rpx;
color: #fff;
font-size: 32rpx;
margin-top: -70rpx;
padding: 0 18rpx;
position: absolute;
right: 30rpx;
}
.number-banner text:last-child {
color: hsla(0,0%,100%,.6);
font-size: 26rpx;
}
.cart {
background-color: #fff;
}
.order-number {
background-color: #f4a213;
color: #fff;
line-height: 46px;
text-align: center;
width: 50%;
}
.order-number button {
background: none;
border: 0;
border-radius: 0;
color: #fff;
font-size: 34rpx;
line-height: inherit;
padding: 0;
}
.order-number button::after {
border: none;
border-radius: 0;
box-sizing: border-box;
content: " ";
height: 0;
left: 0;
position: absolute;
top: 0;
transform: scale(0);
transform-origin: 0 0;
width: 0;
}
.default-btn {
background-color: #ccc;
color: #fff;
line-height: 46px;
text-align: center;
width: 50%;
}
.user-orderJtou-1 {
color: #999;
font-size: 26rpx;
position: absolute;
transform: rotate(-90deg);
}
.user-orderJtou-1,.user-orderJtou-2 {
transition: all .2s;
}
.user-orderJtou-2 {
transform: rotate(90deg);
}
.flow_num {
background: #ff495e;
border-radius: 30rpx;
height: 30rpx;
min-width: 30rpx;
position: absolute;
right: 20rpx;
top: 10rpx;
}
.goods-cont-li .wxParse-inline {
padding: 20rpx 10rpx;
}
.goods-cont-li image {
display: block;
margin: 0 auto;
width: 100%;
}
.goods-cont-li .wxParse-inline {
font-size: 30rpx;
}
.comment-num {
color: #333;
font-size: 28rpx;
margin-top: -20rpx;
position: absolute;
right: 34px;
top: 50%;
}
.top-nav-bar {
display: flex;
flex-wrap: wrap;
font-size: 31rpx;
padding: 12px;
}
#top-nav-bar-true text {
border: 1rpx solid #ff495e;
color: #ff495e;
}
#top-nav-bar-0 span {
color: #444;
}
.footer-fixed .goods-fixed-icon {
background: #fff;
border-left: 1rpx solid #eee;
height: 92rpx;
margin: 0 auto;
padding: 0 6rpx;
position: relative;
width: 150rpx;
}
.footer-fixed .goods-fixed-icon:first-child {
border-left: none;
}
.footer-fixed .goods-fixed-icon image {
display: block;
height: 56rpx;
left: 0;
margin-left: 30rpx;
margin-top: 17rpx;
position: absolute;
top: 0;
width: 56rpx;
}
.footer-fixed .goods-fixed-icon text {
color: #7a7e83;
font-size: 48rpx;
}
.footer-fixed .goods-fixed-icon .bargain-icon {
height: 50rpx;
}
.footer-fixed .goods-fixed-icon .bargain-icon image {
height: 50rpx;
margin-top: -40rpx;
width: 50rpx;
}
.footer-fixed .goods-fixed-icon .bargain-home {
margin-top: 6rpx;
text-align: center;
}
.footer-fixed .goods-fixed-icon .flow_num text {
color: #fff;
display: block;
font-size: 22rpx;
text-align: center;
}
.footer-fixed .goods-fixed-icon .icon-shoucang {
font-size: 40rpx;
}
.footer-fixed .goods-fixed-icon .s_cont {
color: #ff495e;
}
.colour-box {
background: #e64340;
color: #fff;
font-size: 26rpx;
line-height: 26rpx;
margin-right: 10rpx;
padding: 4rpx 8rpx;
text-align: center;
}
.goods-title {
margin-top: 8rpx;
}

View File

@@ -0,0 +1,192 @@
var t = require("../../@babel/runtime/helpers/defineProperty"), a = getApp();
Page({
data: t({
searchColor: "rgba(0,0,0,0.4)",
searchSize: "15",
searchName: "搜索商品",
pageTriggered: !1,
scrollHeight: null,
showView: !1,
arrange: "arrange",
sortType: "all",
sortPrice: !1,
sortColour: !1,
option: {},
list: {},
noList: !0,
no_more: !1,
page: 1,
searchValue: "",
cateList: [],
cate_id: 0,
colourList: [],
colour_id: 0,
hideNotice: !1,
storeInfo: {},
tabTxt: "成色",
tab: !0
}, "colour_id", 0),
onLoad: function(t) {
a.setTitle();
var e = this;
e.setListHeight(), e.getCategoryList(), e.getColourList(), e.getStoreInfo(), e.setData({
option: t
}, function() {
e.getGoodsList(!0);
});
},
onPullDownRefresh: function() {
var t = this;
wx.showLoading({
title: "刷新中..."
}), setTimeout(function() {
t.onRefresh();
}, 1e3), wx.showNavigationBarLoading(), this.setData({
pageTriggered: !0,
page: 1
});
},
onRefresh: function() {
var t = this;
t.getGoodsList(!0), setTimeout(function() {
wx.hideLoading(), wx.hideNavigationBarLoading(), t.setData({
pageTriggered: !1
});
}, 500);
},
filterTab: function(t) {
console.log(111), this.setData({
tab: !this.data.tab,
page: 1
});
},
filter: function(t) {
var a = t.currentTarget.dataset.id, e = t.currentTarget.dataset.txt, o = this.data.tabTxt;
o = e, this.setData({
tab: !0,
tabTxt: o,
colour_id: a,
jiage_txt: e
}), this.getGoodsList(!0);
},
getCategoryList: function() {
var t = this;
a._get("category/lists", {}, function(a) {
var e = a.data;
e.list.unshift({
category_id: 0,
name: "全部"
}), t.setData({
cateList: e.list
});
});
},
getStoreInfo: function() {
var t = this;
a._get("index/getStoreInfo", {}, function(a) {
var e = a.data;
console.log(e), t.setData({
storeInfo: e.store
});
});
},
switchNotice: function() {
this.setData({
hideNotice: !0
});
},
getColourList: function() {
var t = this;
a._get("goods/getColourList", {}, function(a) {
var e = a.data;
t.setData({
colourList: e.list
});
});
},
getSearchContent: function(t) {
this.data.searchValue = t.detail.value;
},
search: function() {
this.getGoodsList(!0);
},
searchCate: function(t) {
console.log("栏目ID"), console.log(t.currentTarget.dataset.category_id), this.setData({
cate_id: t.currentTarget.dataset.category_id,
page: 1
}), this.getGoodsList(!0);
},
getGoodsList: function(t, e) {
wx.showLoading({
title: "刷新中..."
}), console.log(this.data.searchValue);
var o = this;
a._get("goods/lists", {
page: e || 1,
sortType: o.data.sortType,
sortPrice: o.data.sortPrice ? 1 : 0,
sortColour: o.data.sortColour ? 1 : 0,
category_id: o.data.cate_id || 0,
colour_id: o.data.colour_id || 0,
search: o.data.searchValue || ""
}, function(a) {
wx.hideLoading(), console.log(a);
var e = a.data.list, i = o.data.list;
!0 === t || void 0 === i.data ? o.setData({
list: e,
noList: !1
}) : o.setData({
"list.data": i.data.concat(e.data)
});
});
},
setListHeight: function() {
var t = this;
wx.getSystemInfo({
success: function(a) {
t.setData({
scrollHeight: a.windowHeight - 160
});
}
});
},
switchSortType: function(t) {
var a = this, e = t.currentTarget.dataset.type, o = "price" !== e || !a.data.sortPrice, i = "colour" !== e || !a.data.sortColour;
a.setData({
list: {},
page: 1,
sortType: e,
sortPrice: o,
sortColour: i,
tab: !0
}, function() {
a.getGoodsList(!0);
});
},
toSynthesize: function(t) {
wx.navigateTo({
url: "../category/screen?objectId="
});
},
onChangeShowState: function() {
this.setData({
showView: !this.data.showView,
arrange: this.data.arrange ? "" : "arrange"
});
},
bindDownLoad: function() {
if (console.log("this.data.page", this.data.page), console.log("this.data.list.last_page", this.data.list.last_page),
this.data.page >= this.data.list.last_page) return this.setData({
no_more: !0
}), !1;
this.getGoodsList(!1, ++this.data.page);
},
onShareAppMessage: function() {
return {
title: "小程序首页",
desc: "",
path: "/pages/index/index"
};
}
});

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,89 @@
<view class="container">
<view class="list-header">
<view class="notice-wrap" hidden="{{hideNotice}}" wx:if="{{storeInfo.notice.length>0}}">
<view class="tongzhitext">
<text class="tongzhi-text">{{storeInfo.notice}}</text>
</view>   <view bindtap="switchNotice" class="closeView">x</view>
</view>
<view class="index-search-box dis-flex" style="position:static">
<view class="dis-flex search-input-box flex-box">
<view class="search-input">
<view class="dis-flex search-box">
<view class="left">
<icon color="rgba(180,180,180,1)" size="15" type="search"></icon>
</view>
<view class="right">
<input bindinput="getSearchContent" class="input" placeholder="请输入您搜索的商品" placeholderStyle="color:#aba9a9" type="text"></input>
</view>
</view>
</view>
<view class="serch-button">
<button bindtap="search" type="warn"> 搜索 </button>
</view>
</view>
</view>
<view class="index_sale search-cate-box ">
<scroll-view class="search-cate" scrollX="true">
<view hoverClass="none" style="display: inline-block;" wx:for="{{cateList}}" wx:key="this">
<view bindtap="searchCate" class="page-column {{cate_id==item.category_id?'search-cate-activity':''}}" data-category_id="{{item.category_id}}">
<view class="content ">
<text>{{item.name}}</text>
</view>
</view>
</view>
</scroll-view>
</view>
<view></view>
<view class="store_nav_cont dis-flex b-f b-b">
<view bindtap="switchSortType" class="flex-box t-c p-r" data-index="0 " data-type="all" id="list-{{sortType==='all'?true:0}}">
<text>发布时间</text>
</view>
<view bindtap="switchSortType" class="flex-box t-c p-r" data-index="2" data-type="price" id="list-{{sortType==='price'?true:0}}">
<text class="price"> 价格</text>
<text class="iconfont icon-jiantou-copy tf-180 top_jiantou {{sortPrice?'':'active'}}"></text>
<text class="iconfont icon-jiantou-copy bot_jiantou {{sortPrice?'active':''}}"></text>
</view>
<view bindtap="filterTab" class="flex-box t-c p-r" data-index="1" id="list-{{tab===false?true:0}}">
<text>{{tabTxt}}</text>
</view>
</view>
<view class="tabLayer" hidden="{{tab}}">
<text bindtap="filter" class="{{colour_id==0?'active':''}}" data-id="0" data-index="1" data-txt="成色">全部</text>
<text bindtap="filter" class="{{colour_id==85?'active':''}}" data-id="85" data-index="1" data-txt="85新">85新</text>
<text bindtap="filter" class="{{colour_id==90?'active':''}}" data-id="90" data-index="1" data-txt="9成新">9成新</text>
<text bindtap="filter" class="{{colour_id==95?'active':''}}" data-id="95" data-index="1" data-txt="95新">95新</text>
<text bindtap="filter" class="{{colour_id==99?'active':''}}" data-id="99" data-index="1" data-txt="99新">99新</text>
</view>
<scroll-view bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="bindDownLoad" class="weui-panel weui-panel_access" refresherEnabled="true" refresherTriggered="{{pageTriggered}}" scrollY="true" style="height: {{scrollHeight}}px; width: 750rpx; " throttle="{{false}}" wx:if="{{list.data.length>0}}">
<view class="new">
<view class="category-list {{arrange}}">
<navigator class="list b-f" hoverClass="none" url="../goods/index?goods_id={{item.goods_id}}" wx:for="{{list.data}}" wx:key="list">
<view class="left">
<view class="img">
<image class="goodsImg" mode="scaleToFill" src="{{item.image[0].file_path}}"></image>
</view>
</view>
<view class="right">
<view class="cont">
<text class="f-28 title twolist-hidden m-top10">
<text class="colour-box f-20" wx:if="{{item.colour>0}}">{{colourList[item.colour]}}</text>
<text>{{item.goods_name}}</text>
</text>
<view class="f-26" style="color: #555;"> {{item.goods_title.length>0?item.goods_title:' '}} </view>
<view class="price f-30 col-m"> ¥{{item.goods_min_price}} <text class="del f-22" wx:if="{{item.goods_sku.line_price>0}}">{{item.goods_sku.line_price}}</text>
</view>
</view>
</view>
</navigator>
</view>
</view>
<view class="no-more f-30" hidden="{{!no_more}}">亲, 没有更多了</view>
</scroll-view>
</view>
<view class="yoshop-notcont" style="margin-top:260px;" wx:if="{{!noList&&!list.data.length}}">
<view class="img">
<image mode="aspectFit" src="../../images/no_content.png"></image>
</view>
<text class="cont">亲, 没有相关内容</text>
</view>
</view>

View File

@@ -0,0 +1,358 @@
.store_nav_cont {
padding: 10px 0;
}
.store_nav_cont #list-true {
color: #ff495e;
font-size: 28rpx;
}
.store_nav_cont #list-0 {
color: #333;
font-size: 28rpx;
}
.store_nav_cont #list-0 .icon-fenlei {
color: #777;
font-size: 28rpx;
padding-left: 8rpx;
}
.store_nav_cont #list-true .icon-fenlei {
color: #ff495e;
font-size: 28rpx;
padding-left: 8rpx;
}
.price {
margin-top: 10rpx;
}
.title {
height: 75rpx!important;
}
.store_nav_cont #list-0 .top_jiantou,.store_nav_cont #list-true .top_jiantou {
color: #777;
font-size: 18rpx;
margin-top: -16rpx;
position: absolute;
right: 52rpx;
top: 50%;
}
.store_nav_cont #list-0 .bot_jiantou,.store_nav_cont #list-true .bot_jiantou {
color: #777;
font-size: 18rpx;
margin-top: -2rpx;
position: absolute;
right: 52rpx;
top: 50%;
}
.store_nav_cont #list-true .bot_jiantou.active,.store_nav_cont #list-true .top_jiantou.active {
color: #ff495e;
}
.container {
position: relative;
}
.cate-btn {
background: #ff495e;
bottom: 18rpx;
color: #fff;
font-size: 20rpx;
padding: 4px 18rpx;
right: 18rpx;
}
.index-cont-search icon {
left: 0;
margin-left: 20rpx;
}
.index-search-box {
background: #fff;
border-bottom: 1px solid #eee;
left: 0rpx;
padding: 18rpx 13rpx;
position: fixed;
right: 0rpx;
top: 1rpx;
z-index: 999;
}
.index-search {
background: #fff;
border-bottom: 0;
border-radius: 50rpx;
box-sizing: border-box;
color: #999;
font-size: 32rpx;
height: 64rpx;
line-height: 64rpx;
margin: 0 10rpx;
overflow: hidden;
position: relative;
}
.list-right {
width: 60rpx;
}
.list-right text {
font-size: 40rpx;
height: 64rpx;
line-height: 64rpx;
}
.list-header {
left: 0;
position: fixed;
right: 0;
top: 1rpx;
}
.no-more {
color: #737373;
margin: 10px 0;
text-align: center;
}
.category-list {
overflow: hidden;
}
.category-list .list {
box-sizing: border-box;
float: left;
width: 50%;
}
.category-list .list:nth-child(2n) {
border-bottom: 4px solid #f7f7f7;
border-left: 2px solid #f7f7f7;
}
.category-list .list:nth-child(2n-1) {
border-bottom: 4px solid #f7f7f7;
border-right: 2px solid #f7f7f7;
}
.category-list.arrange .list {
border-bottom: 1rpx solid #f7f7f7;
overflow: hidden;
padding: 15rpx;
width: 100%;
}
.category-list.arrange .list .left {
float: left;
width: 35%;
}
.category-list.arrange .list .right {
float: left;
width: 65%;
}
.category-list.arrange .list .left .img image {
height: 220rpx;
width: 220rpx;
}
.search-input-box {
background: #f7f7f7;
height: 64rpx;
margin-right: 10rpx;
width: auto;
}
.search-input {
border-radius: 5px 0 0 5px;
box-sizing: border-box;
overflow: hidden;
padding-left: 10rpx;
width: 80%;
}
.search-input input {
font-size: 30rpx;
height: 64rpx;
line-height: 64rpx;
}
.serch-button {
box-sizing: border-box;
width: 20%;
}
.serch-button button {
border-radius: 0 5px 5px 0;
font-size: 28rpx;
height: 64rpx;
line-height: 64rpx;
}
.search-cate-box {
height: 70rpx;
}
.search-cate {
position: relative;
top: 30%;
}
.page-column {
background-color: #f7f7f7;
border-radius: 6rpx;
margin: 0 20rpx;
padding: 10rpx 0rpx!important;
text-align: center;
}
.search-cate-activity {
background-color: #e64340;
color: #fff;
}
.colour-box {
background: #e64340;
color: #fff;
font-size: 26rpx;
line-height: 26rpx;
margin-right: 10rpx;
padding: 4rpx 8rpx;
text-align: center;
}
@-webkit-keyframes remindMessage {
0% {
-webkit-transform: translateX(90%);
}
100% {
-webkit-transform: translateX(-180%);
}
}
@keyframes remindMessage {
0% {
-webkit-transform: translateX(90%);
}
100% {
-webkit-transform: translateX(-180%);
}
}
.tongzhitext {
margin-left: 10rpx;
margin-right: 80rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tongzhi-text {
animation: remindMessage 14s linear infinite;
display: block;
}
.notice-wrap,.tongzhi-text {
color: #d09868;
font-size: 28rpx;
width: 100%;
}
.notice-wrap {
background: #ffebda;
height: 60rpx;
line-height: 60rpx;
}
.closeView {
font-size: 35rpx;
height: 45rpx;
line-height: 45rpx;
position: absolute;
right: 20rpx;
text-align: center;
top: 5rpx;
width: 45rpx;
}
.clear {
clear: both;
overflow: hidden;
}
.tabTit {
background: #fff;
border-bottom: 1px solid #eee;
font-size: 15px;
height: 90rpx;
line-height: 90rpx;
position: fixed;
text-align: center;
top: 0;
width: 750rpx;
z-index: 1;
}
.tabTit .active {
background: #fff;
color: #e64340;
}
.tabTit .active image {
background: none;
transform: rotate(180deg);
}
.tabTit image {
height: 26rpx;
margin-left: 5px;
vertical-align: middle;
width: 26rpx;
}
.tabLayer {
background: #fff;
border-bottom: 1px solid #eee;
box-shadow: 0 5px 5px rgba(0,0,0,.15);
overflow: hidden;
padding-bottom: 40rpx;
position: fixed;
text-align: center;
top: 340rpx;
width: 750rpx;
z-index: 1;
}
.tabLayer text {
border: 1px solid #eee;
float: left;
font-size: 15px;
height: 60rpx;
line-height: 60rpx;
margin: 20rpx 0 0 26rpx;
width: 210rpx;
}
.tabLayer .active {
border-color: #e64340;
color: #e64340;
}
.flex1 {
display: block;
flex: 1;
overflow: hidden;
}
.box {
display: -ms-flexbox;
display: flex;
}

View File

@@ -0,0 +1,9 @@
<view class="diy-banner">
<swiper autoplay="{{autoplay}}" bindchange="bindChange" circular="{{true}}" class="banner-box swiper-box dot-{{item.style.btnShape}}" data-item-key="{{item_key}}" duration="{{duration}}" indicatorActiveColor="#000" indicatorColor="{{item.style.btnColor}}" indicatorDots="{{indicatorDots}}" interval="{{interval}}" style="height:{{imgHeights[item_key][ imgCurrent[item_key] ]}}rpx">
<navigator hoverClass="none" url="/{{banner.linkUrl}}" wx:for="{{item.data}}" wx:for-item="banner" wx:key="this">
<swiper-item itemId="{{index}}">
<image bindload="imagesHeight" class="slide-image" data-id="{{index}}" data-item-key="{{item_key}}" src="{{banner.imgUrl}}"></image>
</swiper-item>
</navigator>
</swiper>
</view>

View File

@@ -0,0 +1,32 @@
.diy-banner {
position: relative;
}
.diy-banner .linear {
background: linear-gradient(#111,transparent);
height: 3.4rem;
left: 0;
opacity: .6;
position: absolute;
top: 0;
width: 100%;
z-index: 9;
}
.swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal {
margin-bottom: 2rpx;
}
.swiper-box .wx-swiper-dot {
height: 20rpx;
width: 20rpx;
}
.swiper-box.dot-rectangle .wx-swiper-dot {
border-radius: unset;
width: 30rpx;
}
.swiper-box.dot-square .wx-swiper-dot {
border-radius: unset;
}

View File

@@ -0,0 +1,10 @@
<view class="diy-search-box col-f ts-3">
<view class="dis-flex">
<view class="diy-search flex-box angle-{{item.style.searchStyle}} text-{{item.style.textAlign}}">
<navigator class="cont" hoverClass="none" openType="navigate" url="../search/index">
<text class="iconfont icon-sousuo f-30"></text>
<text class="f-28">{{item.params.placeholder}}</text>
</navigator>
</view>
</view>
</view>

View File

@@ -0,0 +1,43 @@
.diy-search-box {
background: #f1f1f2;
padding: 10px 24rpx;
position: unset;
}
.diy-search-box .diy-search {
background: #fff;
border-bottom: 0;
border-radius: unset;
box-sizing: border-box;
color: #fff;
line-height: 60rpx;
margin: 0 auto;
overflow: hidden;
padding: 0 10px;
position: relative;
width: 90%;
}
.diy-search-box .diy-search .cont .icon-sousuo {
margin-right: 10rpx;
}
.diy-search-box text {
color: #999;
}
.diy-search-box .diy-search.angle-radius {
border-radius: 5px;
}
.diy-search-box .diy-search.angle-round {
border-radius: 80rpx;
}
.diy-search-box .diy-search.text-center {
text-align: center;
}
.diy-search-box .diy-search.text-right {
text-align: right;
}

View File

@@ -0,0 +1,61 @@
var t = getApp();
Page({
data: {
indicatorDots: !0,
autoplay: !0,
interval: 3e3,
duration: 800,
imgHeights: {},
imgCurrent: {},
items: {},
newest: {},
best: {},
scrollTop: 0
},
onLoad: function() {
t.setTitle(), t.setNavigationBar(), this.getIndexData();
},
getIndexData: function() {
var a = this;
t._get("index/page", {}, function(t) {
a.setData(t.data);
});
},
imagesHeight: function(t) {
var a = t.target.dataset.id, e = t.target.dataset.itemKey, i = 750 / (t.detail.width / t.detail.height), s = this.data.imgHeights;
void 0 === s[e] && (s[e] = {}), s[e][a] = i;
var n = this.data.imgCurrent;
void 0 === n[e] && (n[e] = Object.keys(this.data.items[e].data)[0]), this.setData({
imgHeights: s,
imgCurrent: n
});
},
bindChange: function(t) {
var a = t.target.dataset.itemKey, e = this.data.imgCurrent;
e[a] = t.detail.currentItemId, this.setData({
imgCurrent: e
});
},
goTop: function(t) {
this.setData({
scrollTop: 0
});
},
scroll: function(t) {
this.setData({
indexSearch: t.detail.scrollTop
}), t.detail.scrollTop > 300 ? this.setData({
floorstatus: !0
}) : this.setData({
floorstatus: !1
});
},
onShareAppMessage: function() {
return {
title: "小程序首页",
desc: "",
path: "/pages/index/index"
};
}
});

View File

@@ -0,0 +1,4 @@
{
"enablePullDownRefresh": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,53 @@
<view class="container">
<scroll-view bindscroll="scroll" scrollTop="{{scrollTop}}" scrollY="true" style="position:absolute; top:0; left:0; right:0; bottom:0;">
<block wx:for="{{items}}" wx:for-index="item_key" wx:key="this">
<include src="components/search/search.wxml" wx:if="{{item.type==='search'}}"></include>
<include src="components/banner/banner.wxml" wx:if="{{item.type==='banner'}}"></include>
</block>
<view class="recommended-index-list m-top20">
<view class="title-header b-f t-c f-32 col-3">新品推荐</view>
</view>
<view class="index_sale ">
<scroll-view scrollX="true">
<navigator hoverClass="none" style="display: inline-block;" url="../goods/index?goods_id={{item.goods_id}}" wx:for="{{newest}}" wx:key="this">
<view class="page-column">
<view class="sale_img">
<image mode="aspectFill" src="{{item.image[0].file_path}}"></image>
</view>
<view class="content onelist-hidden">
<text>{{item.goods_name}}</text>
</view>
<text class="price col-m f-30">¥{{item.spec[0].goods_price}}</text>
</view>
</navigator>
</scroll-view>
</view>
<view class="title-hrbg" style="margin-top:10rpx">
<text class="cont">
<text class="iconfont icon-huo col-m"></text>猜您喜欢 </text>
<view class="hr"></view>
</view>
<view class="category-list">
<navigator class="list b-f" hoverClass="none" url="../goods/index?goods_id={{item.goods_id}}" wx:for="{{best}}" wx:key="this">
<view class="left">
<view class="img">
<image class="goodsImg" mode="scaleToFill" src="{{item.image[0].file_path}}"></image>
</view>
</view>
<view class="right">
<view class="cont">
<text class="f-30 title twolist-hidden m-top10">{{item.goods_name}}</text>
<text class="price f-34 col-m f-w">¥{{item.spec[0].goods_price}}</text>
</view>
</view>
</navigator>
</view>
<view class="title-footer p-r">
<text class="f-24 col-9 cont">我是有底线的</text>
<view class="hr"></view>
</view>
</scroll-view>
<view bindtap="goTop" class="widget-goTop" wx:if="{{floorstatus}}">
<text class="iconfont icon-fanhuidingbu"></text>
</view>
</view>

View File

@@ -0,0 +1,110 @@
.diy-search-box {
background: #f1f1f2;
padding: 10px 24rpx;
position: unset;
}
.diy-search-box .diy-search {
background: #fff;
border-bottom: 0;
border-radius: unset;
box-sizing: border-box;
color: #fff;
line-height: 60rpx;
margin: 0 auto;
overflow: hidden;
padding: 0 10px;
position: relative;
width: 90%;
}
.diy-search-box .diy-search .cont .icon-sousuo {
margin-right: 10rpx;
}
.diy-search-box text {
color: #999;
}
.diy-search-box .diy-search.angle-radius {
border-radius: 5px;
}
.diy-search-box .diy-search.angle-round {
border-radius: 80rpx;
}
.diy-search-box .diy-search.text-center {
text-align: center;
}
.diy-search-box .diy-search.text-right {
text-align: right;
}
.diy-banner {
position: relative;
}
.diy-banner .linear {
background: linear-gradient(#111,transparent);
height: 3.4rem;
left: 0;
opacity: .6;
position: absolute;
top: 0;
width: 100%;
z-index: 9;
}
.swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal {
margin-bottom: 2rpx;
}
.swiper-box .wx-swiper-dot {
height: 20rpx;
width: 20rpx;
}
.swiper-box.dot-rectangle .wx-swiper-dot {
border-radius: unset;
width: 30rpx;
}
.swiper-box.dot-square .wx-swiper-dot {
border-radius: unset;
}
.title-hrbg {
color: #888;
height: 80rpx;
line-height: 80rpx;
margin-top: 30rpx;
overflow: hidden;
position: relative;
text-align: center;
z-index: 1;
}
.title-hrbg .cont {
background: #f7f7f7;
font-size: 28rpx;
padding: 1rem .6rem;
z-index: 10;
}
.title-hrbg .cont .icon-huo {
padding-right: 10rpx;
}
.title-hrbg .hr {
background: #ddd;
border: 0;
height: 1rpx;
left: 10%;
margin-top: 1px;
position: absolute;
right: 10%;
top: 50%;
z-index: -1;
}

View File

@@ -0,0 +1,39 @@
var o = getApp();
Page({
data: {},
onLoad: function(o) {},
getUserInfo: function(e) {
var n = this;
o.getUserInfo(e, function() {
n.onNavigateBack();
});
},
getUserProfile: function() {
console.log("getUserProfile");
var e = this;
try {
wx.getUserProfile({
lang: "zh_CN",
desc: "获取用户相关信息",
success: function(n) {
var t = n.userInfo;
console.log("用户同意了授权"), console.log("userInfo", t), o.getUserInfo(t, function() {
e.onNavigateBack(1);
});
},
fail: function() {
console.log("用户拒绝了授权");
}
});
} catch (e) {
console.log("error", e.message), "wx.getUserProfile is not a function" === e.message ? o.showError("wx.getUserProfile 接口无法使用,请升级到最新版微信") : o.showError(error.message);
}
},
onNotLogin: function() {
this.onNavigateBack();
},
onNavigateBack: function() {
wx.navigateBack();
}
});

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "授权登录",
"usingComponents": {}
}

View File

@@ -0,0 +1,15 @@
<view class="container">
<view class="wechatapp">
<view class="header">
<open-data class="" type="userAvatarUrl"></open-data>
</view>
</view>
<view class="auth-title">申请获取以下权限</view>
<view class="auth-subtitle">获得你的公开信息(昵称、头像等)</view>
<view class="login-btn">
<button catchtap="getUserProfile" class="btn-normal">授权登录</button>
</view>
<view class="no-login-btn">
<button catchtap="onNotLogin" class="btn-normal">暂不登录</button>
</view>
</view>

View File

@@ -0,0 +1,66 @@
page {
background: #fff;
font-size: 32rpx;
}
.container {
padding: 0 60rpx;
}
.wechatapp {
border-bottom: 1rpx solid #e3e3e3;
margin-bottom: 72rpx;
padding: 80rpx 0 48rpx;
text-align: center;
}
.wechatapp .header {
border: 2px solid #fff;
border-radius: 50%;
box-shadow: 1px 0 5px rgba(50,50,50,.3);
height: 190rpx;
margin: 0rpx auto 0;
overflow: hidden;
width: 190rpx;
}
.auth-title {
color: #585858;
font-size: 34rpx;
margin-bottom: 40rpx;
}
.auth-subtitle {
color: #888;
font-size: 28rpx;
margin-bottom: 88rpx;
}
.login-btn {
padding: 0 20rpx;
}
.login-btn button {
background: #04be01;
border-radius: 999rpx;
color: #fff;
font-size: 30rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
}
.no-login-btn {
margin-top: 20rpx;
padding: 0 20rpx;
}
.no-login-btn button {
background: #dfdfdf;
border-radius: 999rpx;
color: #fff;
font-size: 30rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
}

View File

@@ -0,0 +1,94 @@
var t = getApp();
Page({
data: {
order_id: null,
order: {},
utype: 0
},
onLoad: function(t) {
this.data.order_id = t.order_id, this.getOrderDetail(t.order_id), this.getUserDetail();
},
onShow: function() {
this.getUserDetail();
},
getOrderDetail: function(e) {
var r = this;
t._get("user.order/detail", {
order_id: e
}, function(t) {
r.setData(t.data);
});
},
getUserDetail: function() {
var e = this;
t._get("user.index/detail", {}, function(t) {
console.log(t), e.setData({
utype: t.data.userInfo.utype
});
});
},
goodsDetail: function(t) {
var e = t.currentTarget.dataset.id;
wx.navigateTo({
url: "../goods/index?goods_id=" + e
});
},
cancelOrder: function(e) {
var r = this.data.order_id;
wx.showModal({
title: "提示",
content: "确认取消订单?",
success: function(e) {
e.confirm && t._post_form("user.order/cancel", {
order_id: r
}, function(t) {
wx.navigateBack();
});
}
});
},
aftermarketOrder: function(t) {
var e = t.currentTarget.dataset.id;
wx.navigateTo({
url: "../aftermarket/create?order_goods_id=" + e
});
},
payOrder: function(e) {
var r = this, a = r.data.order_id;
wx.showLoading({
title: "正在处理..."
}), t._post_form("user.order/pay", {
order_id: a
}, function(e) {
if (-10 === e.code) return t.showError(e.msg), !1;
wx.requestPayment({
timeStamp: e.data.timeStamp,
nonceStr: e.data.nonceStr,
package: "prepay_id=" + e.data.prepay_id,
signType: "MD5",
paySign: e.data.paySign,
success: function(t) {
r.getOrderDetail(a);
},
fail: function() {
t.showError("订单未支付");
}
});
});
},
receipt: function(e) {
var r = this, a = r.data.order_id;
wx.showModal({
title: "提示",
content: "确认收到商品?",
success: function(e) {
e.confirm && t._post_form("user.order/receipt", {
order_id: a
}, function(t) {
r.getOrderDetail(a);
});
}
});
}
});

Some files were not shown because too many files have changed in this diff Show More