修改小程序与app的兼容文件
This commit is contained in:
1
App.vue
1
App.vue
@ -16,6 +16,7 @@
|
||||
|
||||
<style lang="less">
|
||||
/*每个页面公共css */
|
||||
@import "animate.css";
|
||||
@import "./assets/iconfont/iconfont.css";
|
||||
@import "./assets/css/base.less";
|
||||
@import "./assets/css/reset.less";
|
||||
|
27
api/order.js
27
api/order.js
@ -9,7 +9,9 @@ import request from "@/utils/request";
|
||||
* @returns {*}
|
||||
*/
|
||||
export function postOrderConfirm(cartId) {
|
||||
return request.post("/order/confirm", { cartId });
|
||||
return request.post("/order/confirm", {
|
||||
cartId
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,7 +64,9 @@ export function getOrderList(data) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function cancelOrder(id) {
|
||||
return request.post("/order/cancel", { id });
|
||||
return request.post("/order/cancel", {
|
||||
id
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,7 +98,9 @@ export function postOrderRefund(data) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function takeOrder(uni) {
|
||||
return request.post("/order/take", { uni });
|
||||
return request.post("/order/take", {
|
||||
uni
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,7 +108,9 @@ export function takeOrder(uni) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function delOrder(uni) {
|
||||
return request.post("/order/del", { uni });
|
||||
return request.post("/order/del", {
|
||||
uni
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,12 +126,19 @@ export function express(params) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function payOrder(uni, paytype, from) {
|
||||
return request.post("order/pay", { uni, paytype, from });
|
||||
return request.post("order/pay", {
|
||||
uni,
|
||||
paytype,
|
||||
from
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 订单核销
|
||||
* @returns {*}
|
||||
*/
|
||||
export function orderVerific(verify_code, is_confirm) {
|
||||
return request.post("order/order_verific", { verify_code, is_confirm });
|
||||
return request.post("order/order_verific", {
|
||||
verify_code,
|
||||
is_confirm
|
||||
});
|
||||
}
|
||||
|
62
api/store.js
62
api/store.js
@ -4,28 +4,36 @@ import request from "@/utils/request";
|
||||
* 商品分类
|
||||
* */
|
||||
export function getCategory() {
|
||||
return request.get("/category", {}, { login: false });
|
||||
return request.get("/category", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品详情
|
||||
* */
|
||||
export function getProductDetail(id) {
|
||||
return request.get("/product/detail/" + id, {}, { login: true });
|
||||
export function getProductDetail(id, data) {
|
||||
return request.get("/product/detail/" + id, data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品分销二维码
|
||||
* */
|
||||
export function getProductCode(id) {
|
||||
return request.get("/product/code/" + id, {}, { login: true });
|
||||
return request.get("/product/code/" + id, {}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品列表
|
||||
* */
|
||||
export function getProducts(q) {
|
||||
return request.get("/products", q, { login: false });
|
||||
return request.get("/products", q, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -47,9 +55,12 @@ export function toCollect(id, category) {
|
||||
* */
|
||||
export function getHostProducts(page, limit) {
|
||||
return request.get(
|
||||
"/product/hot",
|
||||
{ page: page, limit: limit },
|
||||
{ login: false }
|
||||
"/product/hot", {
|
||||
page: page,
|
||||
limit: limit
|
||||
}, {
|
||||
login: false
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@ -57,7 +68,9 @@ export function getHostProducts(page, limit) {
|
||||
* 精品、热门、首发列表
|
||||
* */
|
||||
export function getGroomList(type) {
|
||||
return request.get("/groom/list/" + type, {}, { login: false });
|
||||
return request.get("/groom/list/" + type, {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -78,7 +91,9 @@ export function getCartList() {
|
||||
* 购物车 删除
|
||||
* */
|
||||
export function postCartDel(ids) {
|
||||
return request.post("/cart/del", { ids });
|
||||
return request.post("/cart/del", {
|
||||
ids
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -92,40 +107,55 @@ export function getCartCount(data) {
|
||||
* 购物车 修改商品数量
|
||||
* */
|
||||
export function changeCartNum(id, number) {
|
||||
return request.post("/cart/num", { id, number });
|
||||
return request.post("/cart/num", {
|
||||
id,
|
||||
number
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索推荐关键字
|
||||
*/
|
||||
export function getSearchKeyword() {
|
||||
return request.get("/search/keyword", {}, { login: false });
|
||||
return request.get("/search/keyword", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品评论列表
|
||||
*/
|
||||
export function getReplyList(id, q) {
|
||||
return request.get("/reply/list/" + id, q, { login: true });
|
||||
return request.get("/reply/list/" + id, q, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品评价数量和好评度
|
||||
*/
|
||||
export function getReplyConfig(id) {
|
||||
return request.get("/reply/config/" + id, {}, { login: true });
|
||||
return request.get("/reply/config/" + id, {}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 评价页面获取单个产品详情
|
||||
*/
|
||||
export function postOrderProduct(unique) {
|
||||
return request.post("/order/product", { unique }, { login: true });
|
||||
return request.post("/order/product", {
|
||||
unique
|
||||
}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交评价页面;
|
||||
*/
|
||||
export function postOrderComment(data) {
|
||||
return request.post("/order/comment", data, { login: true });
|
||||
return request.post("/order/comment", data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
92
api/user.js
92
api/user.js
@ -4,7 +4,9 @@ import request from "@/utils/request";
|
||||
* 省市区
|
||||
*/
|
||||
export function district(data) {
|
||||
return request.get("/citys", data, { login: false });
|
||||
return request.get("/citys", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -12,7 +14,9 @@ export function district(data) {
|
||||
* @param data object 用户账号密码
|
||||
*/
|
||||
export function login(data) {
|
||||
return request.post("/login", data, { login: false });
|
||||
return request.post("/login", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -20,7 +24,9 @@ export function login(data) {
|
||||
* @param data object 用户手机号 也只能
|
||||
*/
|
||||
export function loginMobile(data) {
|
||||
return request.post("/login/mobile", data, { login: false });
|
||||
return request.post("/login/mobile", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -28,7 +34,9 @@ export function loginMobile(data) {
|
||||
* @param data object 用户手机号
|
||||
*/
|
||||
export function registerVerify(data) {
|
||||
return request.post("/register/verify", data, { login: false });
|
||||
return request.post("/register/verify", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,7 +44,9 @@ export function registerVerify(data) {
|
||||
* @param data object 用户手机号 验证码 密码
|
||||
*/
|
||||
export function register(data) {
|
||||
return request.post("/register", data, { login: false });
|
||||
return request.post("/register", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,28 +54,38 @@ export function register(data) {
|
||||
* @param data object 用户手机号 验证码 密码
|
||||
*/
|
||||
export function registerReset(data) {
|
||||
return request.post("/register/reset", data, { login: false });
|
||||
return request.post("/register/reset", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 领取优惠券列表
|
||||
* */
|
||||
export function getCoupon(q) {
|
||||
return request.get("/coupons", q, { login: true });
|
||||
return request.get("/coupons", q, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 点击领取优惠券
|
||||
* */
|
||||
export function getCouponReceive(id) {
|
||||
return request.post("/coupon/receive", { couponId: id }, { login: true });
|
||||
return request.post("/coupon/receive", {
|
||||
couponId: id
|
||||
}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 批量领取优惠券
|
||||
* */
|
||||
export function couponReceiveBatch(couponId) {
|
||||
return request.post("/coupon/receive/batch", { couponId });
|
||||
return request.post("/coupon/receive/batch", {
|
||||
couponId
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -87,7 +107,9 @@ export function getUser() {
|
||||
* */
|
||||
export function getUserInfo() {
|
||||
|
||||
return request.get("/userinfo", { login: true });
|
||||
return request.get("/userinfo", {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -95,7 +117,9 @@ export function getUserInfo() {
|
||||
* */
|
||||
export function wxappAuth(data) {
|
||||
|
||||
return request.post("/wxapp/auth", data, { login: false });
|
||||
return request.post("/wxapp/auth", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -116,14 +140,18 @@ export function getAddressList(data) {
|
||||
* 删除地址
|
||||
* */
|
||||
export function getAddressRemove(id) {
|
||||
return request.post("/address/del", { id: id });
|
||||
return request.post("/address/del", {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 设置默认地址
|
||||
* */
|
||||
export function getAddressDefaultSet(id) {
|
||||
return request.post("/address/default/set", { id: id });
|
||||
return request.post("/address/default/set", {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -151,14 +179,20 @@ export function postAddress(data) {
|
||||
* 获取收藏产品
|
||||
* */
|
||||
export function getCollectUser(page, limit) {
|
||||
return request.get("/collect/user", { page: page, limit: limit });
|
||||
return request.get("/collect/user", {
|
||||
page: page,
|
||||
limit: limit
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除收藏产品
|
||||
* */
|
||||
export function getCollectDel(id, category) {
|
||||
return request.post("/collect/del", { id: id, category: category });
|
||||
return request.post("/collect/del", {
|
||||
id: id,
|
||||
category: category
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -172,7 +206,10 @@ export function postCollectAll(data) {
|
||||
* 添加收藏产品
|
||||
* */
|
||||
export function getCollectAdd(id, category) {
|
||||
return request.post("collect/add", { id: id, category: category });
|
||||
return request.post("collect/add", {
|
||||
id: id,
|
||||
category: category
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -186,14 +223,20 @@ export function getSignConfig() {
|
||||
* 签到里的签到列表
|
||||
* */
|
||||
export function getSignList(page, limit) {
|
||||
return request.get("/sign/list", { page: page, limit: limit });
|
||||
return request.get("/sign/list", {
|
||||
page: page,
|
||||
limit: limit
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到列表
|
||||
* */
|
||||
export function getSignMonth(page, limit) {
|
||||
return request.get("/sign/month", { page: page, limit: limit });
|
||||
return request.get("/sign/month", {
|
||||
page: page,
|
||||
limit: limit
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -284,14 +327,17 @@ export function getBalance() {
|
||||
* 活动状态
|
||||
* */
|
||||
export function getActivityStatus() {
|
||||
return request.get("/user/activity", {}, { login: false });
|
||||
return request.get("/user/activity", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 活动状态
|
||||
* */
|
||||
export function getSpreadImg() {
|
||||
return request.get("/spread/banner");
|
||||
export function getSpreadImg(data) {
|
||||
|
||||
return request.get("/spread/banner", data);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -340,7 +386,9 @@ export function bindingPhone(data) {
|
||||
* h5切换公众号登陆
|
||||
* */
|
||||
export function switchH5Login() {
|
||||
return request.post("switch_h5", { from: "wechat" });
|
||||
return request.post("switch_h5", {
|
||||
from: "wechat"
|
||||
});
|
||||
}
|
||||
/*
|
||||
* 获取推广人排行
|
||||
|
@ -1666,8 +1666,9 @@
|
||||
|
||||
.index .wrapper.hot .newProducts .newProductsItem {
|
||||
width: 2.4*100rpx;
|
||||
min-width: 2.4*100rpx;
|
||||
margin-right: 0.2*100rpx;
|
||||
|
||||
flex: 0 2.4*100rpx;
|
||||
}
|
||||
|
||||
.index .wrapper .newProducts .newProductsScroll {
|
||||
@ -1683,9 +1684,11 @@
|
||||
.index .wrapper .newProducts .newProductsItem {
|
||||
border: 1rpx solid #eee;
|
||||
width: 2.4*100rpx;
|
||||
min-width: 2.4*100rpx;
|
||||
border-radius: 0.12*100rpx;
|
||||
overflow: hidden;
|
||||
margin-right: .2*100rpx;
|
||||
flex: 0 2.4*100rpx;
|
||||
}
|
||||
|
||||
.index .wrapper .newProducts:nth-last-child(1) {}
|
||||
|
@ -21,7 +21,7 @@
|
||||
<view class="condition line1">{{ coupon.couponTitle }}</view>
|
||||
<view class="data acea-row row-between-wrapper">
|
||||
<view v-if="coupon.endTime === 0">不限时</view>
|
||||
<view v-else><data-format-t :data="coupon.addTime"></data-format-t> - <data-format-t :data="coupon.endTime"></data-format-t></view>
|
||||
<view v-else><data-format-t :date="coupon.addTime"></data-format-t> - <data-format-t :date="coupon.endTime"></data-format-t></view>
|
||||
<view
|
||||
class="iconfont icon-xuanzhong1 font-color-red"
|
||||
v-if="checked === coupon.id"
|
||||
|
@ -6,18 +6,18 @@ import { dataFormat } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "DataFormat",
|
||||
props: ["data"],
|
||||
props: ["date"],
|
||||
data: function() {
|
||||
return {
|
||||
time: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.time = dataFormat(this.data);
|
||||
this.time = dataFormat(this.date);
|
||||
},
|
||||
watch: {
|
||||
"$props.data"(props) {
|
||||
this.time = dataFormat(this.data);
|
||||
"$props.date"(props) {
|
||||
this.time = dataFormat(this.date);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,22 +2,22 @@
|
||||
<text>{{time}}</text>
|
||||
</template>
|
||||
<script>
|
||||
import { dataFormatT } from "@/utils";
|
||||
import { dateFormatT } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "DataFormatT",
|
||||
props: ["data"],
|
||||
props: ["date"],
|
||||
data: function() {
|
||||
return {
|
||||
time: ""
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.time = dataFormatT(this.data);
|
||||
this.time = dateFormatT(this.date);
|
||||
},
|
||||
watch: {
|
||||
"$props.data"(props) {
|
||||
this.time = dataFormatT(this.data);
|
||||
"$props.date"(props) {
|
||||
this.time = dateFormatT(this.date);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,6 +2,7 @@
|
||||
export const weappPay = (option) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 吊起微信支付
|
||||
console.log(option,9999)
|
||||
uni.requestPayment({
|
||||
...option,
|
||||
timeStamp: option.timeStamp + '',
|
||||
|
10
main.js
10
main.js
@ -3,7 +3,6 @@ import App from './App'
|
||||
|
||||
// import router from "./router";
|
||||
import store from "./store";
|
||||
import animate from "animate.css";
|
||||
import schema from "async-validator";
|
||||
import dialog from "./utils/dialog";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
@ -25,7 +24,6 @@ import {
|
||||
VUE_APP_API_URL
|
||||
} from "@/config";
|
||||
|
||||
Vue.use(animate);
|
||||
Vue.config.productionTip = false;
|
||||
Vue.config.devtools = process.env.NODE_ENV !== "production";
|
||||
|
||||
@ -82,24 +80,24 @@ Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
|
||||
|
||||
// #ifdef H5
|
||||
// H5编译的代码
|
||||
Vue.prototype.$deviceType = 'H5'
|
||||
Vue.prototype.$deviceType = 'h5'
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// App平台编译的代码
|
||||
Vue.prototype.$deviceType = 'App'
|
||||
Vue.prototype.$deviceType = 'app'
|
||||
Vue.prototype.$platform = uni.getSystemInfoSync().platform
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信小程序编译的代码
|
||||
Vue.prototype.$deviceType = 'Weixin'
|
||||
Vue.prototype.$deviceType = 'weixin'
|
||||
// #endif
|
||||
|
||||
console.log(wx,121212)
|
||||
console.log(Vue.prototype.$deviceType)
|
||||
// if(wx){
|
||||
// Vue.prototype.$deviceType = 'Weixin'
|
||||
// Vue.prototype.$deviceType = 'weixin'
|
||||
// }
|
||||
|
||||
app.$mount()
|
||||
|
@ -54,7 +54,27 @@
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
"sdkConfigs" : {
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"appsecret" : "",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
|
@ -45,7 +45,7 @@ export default {
|
||||
console.log(this.$store.getters.userInfo, '获取store里面的 userInfo');
|
||||
cookie.get("spread");
|
||||
// this.toLaunch();
|
||||
if (this.$deviceType == 'App') {
|
||||
if (this.$deviceType == 'app') {
|
||||
// this.toLaunch();
|
||||
this.$yrouter.switchTab({
|
||||
path: '/pages/home/index',
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view v-if="!$store.getters.token&&$deviceType=='Weixin'">
|
||||
<view v-if="!$store.getters.token&&$deviceType=='weixin'">
|
||||
<view class="getUserInfo">
|
||||
<text>您还未允许微信登录授权,请点击下方按钮允许微信授权登录。</text>
|
||||
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button>
|
||||
@ -8,7 +8,7 @@
|
||||
<button @click="back">取消微信登录授权</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!$store.getters.token&&$deviceType!='Weixin'">
|
||||
<view v-if="!$store.getters.token&&$deviceType!='weixin'&&$deviceType=='app'">
|
||||
<view class="getUserInfo">
|
||||
<text>请先登录</text>
|
||||
<button type="primary" @click="this.toLogin">去登录</button>
|
||||
@ -43,6 +43,7 @@
|
||||
...mapState(["isAuthorization"])
|
||||
},
|
||||
onShow() {
|
||||
|
||||
this.UPDATE_AUTHORIZATIONPAGE(true);
|
||||
},
|
||||
onHide() {
|
||||
|
@ -290,6 +290,7 @@ export default {
|
||||
});
|
||||
},
|
||||
goGoodsCon(item) {
|
||||
console.log(item)
|
||||
this.$yrouter.push({
|
||||
path: "/pages/shop/GoodsCon/index",
|
||||
query: { id: item.id }
|
||||
|
@ -44,7 +44,7 @@
|
||||
>拼团</text>
|
||||
<text class="sign cart-color acea-row row-center-wrapper" v-if="order.seckillId > 0">秒杀</text>
|
||||
<text class="sign cart-color acea-row row-center-wrapper" v-if="order.bargainId > 0">砍价</text>
|
||||
<data-format :data="order.addTime"></data-format>
|
||||
<data-format :date="order.addTime"></data-format>
|
||||
</view>
|
||||
<view class="font-color-red">{{ getStatus(order) }}</view>
|
||||
</view>
|
||||
@ -209,7 +209,7 @@ export default {
|
||||
orderList: [],
|
||||
pay: false,
|
||||
payType: ["yue", "weixin"],
|
||||
from: isWeixin() ? "weixin" : "weixinh5"
|
||||
from: this.$deviceType
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
@ -5,7 +5,7 @@
|
||||
<view class="data" :class="refundOrder ? 'on' : ''">
|
||||
<view class="state">{{ orderInfo._status._msg }}</view>
|
||||
<view>
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -144,7 +144,7 @@
|
||||
<view class="item acea-row row-between">
|
||||
<view>下单时间:</view>
|
||||
<view class="conter">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
|
@ -481,6 +481,26 @@
|
||||
uni.showLoading({
|
||||
title: "生成订单中"
|
||||
});
|
||||
let form = {}
|
||||
if (this.$deviceType == 'app') {
|
||||
form.form = 'app'
|
||||
}
|
||||
console.log(this.orderGroupInfo.orderKey, {
|
||||
realName: this.contacts,
|
||||
phone: this.contactsTel,
|
||||
addressId: this.addressInfo.id,
|
||||
useIntegral: this.useIntegral ? 1 : 0,
|
||||
couponId: this.usableCoupon.id || 0,
|
||||
payType: this.active,
|
||||
pinkId: this.pinkId,
|
||||
seckillId: this.orderGroupInfo.seckill_id,
|
||||
combinationId: this.orderGroupInfo.combination_id,
|
||||
bargainId: this.orderGroupInfo.bargain_id,
|
||||
from: this.from,
|
||||
mark: this.mark || "",
|
||||
shippingType: parseInt(shipping_type) + 1,
|
||||
...form
|
||||
})
|
||||
createOrder(this.orderGroupInfo.orderKey, {
|
||||
realName: this.contacts,
|
||||
phone: this.contactsTel,
|
||||
@ -494,9 +514,11 @@
|
||||
bargainId: this.orderGroupInfo.bargain_id,
|
||||
from: this.from,
|
||||
mark: this.mark || "",
|
||||
shippingType: parseInt(shipping_type) + 1
|
||||
shippingType: parseInt(shipping_type) + 1,
|
||||
...form
|
||||
})
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
uni.hideLoading();
|
||||
const data = res.data;
|
||||
switch (data.status) {
|
||||
@ -542,6 +564,7 @@
|
||||
break;
|
||||
case "WECHAT_PAY":
|
||||
weappPay(data.result.jsConfig).then(res => {
|
||||
console.log(res)
|
||||
this.$yrouter.replace({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<view class="order-num">订单:{{ orderInfo.orderId }}</view>
|
||||
<view>
|
||||
<text class="time">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -67,7 +67,7 @@
|
||||
<view class="item acea-row row-between">
|
||||
<view>下单时间:</view>
|
||||
<view class="conter">
|
||||
<data-format :data="orderInfo.addTime"></data-format>
|
||||
<data-format :date="orderInfo.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item acea-row row-between">
|
||||
|
@ -14,7 +14,7 @@
|
||||
<text>订单号:{{ item.orderId }}</text>
|
||||
<text class="time">
|
||||
<text>下单时间:</text>
|
||||
<data-format :data="item.addTime"></data-format>
|
||||
<data-format :date="item.addTime"></data-format>
|
||||
</text>
|
||||
</view>
|
||||
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">
|
||||
|
@ -47,7 +47,6 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import debounce from "lodash.debounce";
|
||||
import { getCategory } from "@/api/store";
|
||||
import { trim } from "@/utils";
|
||||
|
||||
|
@ -6,15 +6,8 @@
|
||||
<view class="money font-color-red">
|
||||
<text>¥</text>
|
||||
<text class="num">{{ storeInfo.price }}</text>
|
||||
<text
|
||||
class="vip-money"
|
||||
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
|
||||
>¥{{ storeInfo.vipPrice }}</text>
|
||||
<image
|
||||
:src="$VUE_APP_RESOURCES_URL+'/images/vip.png'"
|
||||
class="image"
|
||||
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
|
||||
/>
|
||||
<text class="vip-money" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">¥{{ storeInfo.vipPrice }}</text>
|
||||
<image :src="$VUE_APP_RESOURCES_URL+'/images/vip.png'" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
|
||||
</view>
|
||||
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
|
||||
</view>
|
||||
@ -27,11 +20,7 @@
|
||||
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
|
||||
<text class="hide line1 acea-row">
|
||||
<text>优惠券:</text>
|
||||
<text
|
||||
class="activity"
|
||||
v-for="(item, couponListEq) in couponList"
|
||||
:key="couponListEq"
|
||||
>满{{ item.use_min_price }}减{{ item.coupon_price }}</text>
|
||||
<text class="activity" v-for="(item, couponListEq) in couponList" :key="couponListEq">满{{ item.use_min_price }}减{{ item.coupon_price }}</text>
|
||||
</text>
|
||||
<view class="iconfont icon-jiantou"></view>
|
||||
</view>
|
||||
@ -110,11 +99,7 @@
|
||||
<view class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
|
||||
<text>收藏</text>
|
||||
</view>
|
||||
<view
|
||||
@click="goShoppingCart()"
|
||||
class="item animated"
|
||||
:class="animated === true ? 'bounceIn' : ''"
|
||||
>
|
||||
<view @click="goShoppingCart()" class="item animated" :class="animated === true ? 'bounceIn' : ''">
|
||||
<view class="iconfont icon-gouwuche1">
|
||||
<text class="num bg-color-red" v-if="CartCount > 0">{{CartCount}}</text>
|
||||
</view>
|
||||
@ -131,11 +116,7 @@
|
||||
</view>
|
||||
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
|
||||
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
|
||||
<StorePoster
|
||||
v-on:setPosterImageStatus="setPosterImageStatus"
|
||||
:posterImageStatus="posterImageStatus"
|
||||
:posterData="posterData"
|
||||
></StorePoster>
|
||||
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus" :posterData="posterData"></StorePoster>
|
||||
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
|
||||
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
|
||||
<view class="item" v-if="weixinStatus === true" @click="setShareInfoStatus">
|
||||
@ -149,13 +130,7 @@
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></view>
|
||||
<view class="geoPage" v-if="mapShow">
|
||||
<iframe
|
||||
width="100%"
|
||||
height="100%"
|
||||
frameborder="0"
|
||||
scrolling="no"
|
||||
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey"
|
||||
></iframe>
|
||||
<iframe width="100%" height="100%" frameborder="0" scrolling="no" :src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey"></iframe>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -181,10 +156,18 @@ import {
|
||||
getCollectDel,
|
||||
getUserInfo
|
||||
} from "@/api/user";
|
||||
import { isWeixin, PosterCanvas, handleQrCode } from "@/utils";
|
||||
import {
|
||||
isWeixin,
|
||||
PosterCanvas,
|
||||
handleQrCode
|
||||
} from "@/utils";
|
||||
// import { wechatEvevt } from "@/libs/wechat";
|
||||
import { imageBase64 } from "@/api/public";
|
||||
import { mapGetters } from "vuex";
|
||||
import {
|
||||
imageBase64
|
||||
} from "@/api/public";
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "GoodsCon",
|
||||
@ -254,12 +237,13 @@ export default {
|
||||
},
|
||||
computed: mapGetters(["isLogin"]),
|
||||
mounted: function() {
|
||||
console.log(this)
|
||||
let url = handleQrCode();
|
||||
console.log(url);
|
||||
if (url && url.productId) {
|
||||
this.id = url.productId;
|
||||
} else {
|
||||
this.id = this.$yroute.query.id;
|
||||
this.id = this._route.query.id;
|
||||
}
|
||||
this.productCon();
|
||||
},
|
||||
@ -321,7 +305,12 @@ export default {
|
||||
//产品详情接口;
|
||||
productCon: function() {
|
||||
let that = this;
|
||||
getProductDetail(that.id)
|
||||
let form = {}
|
||||
if (this.$deviceType == 'app') {
|
||||
form.form = 'app'
|
||||
}
|
||||
console.log(form, 2222)
|
||||
getProductDetail(that.id, form)
|
||||
.then(res => {
|
||||
that.$set(that, "storeInfo", res.data.storeInfo);
|
||||
that.$set(that.attr, "productAttr", res.data.productAttr);
|
||||
@ -580,10 +569,8 @@ export default {
|
||||
productId: that.id,
|
||||
cartNum: that.attr.productSelect.cart_num,
|
||||
new: news,
|
||||
uniqueId:
|
||||
that.attr.productSelect !== undefined
|
||||
? that.attr.productSelect.unique
|
||||
: ""
|
||||
uniqueId: that.attr.productSelect !== undefined ?
|
||||
that.attr.productSelect.unique : ""
|
||||
};
|
||||
postCartAdd(q)
|
||||
.then(function(res) {
|
||||
|
@ -79,7 +79,6 @@
|
||||
<script>
|
||||
import Recommend from "@/components/Recommend";
|
||||
import { getProducts } from "@/api/store";
|
||||
import debounce from "lodash.debounce";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
|
@ -177,7 +177,6 @@ import {
|
||||
import { postCollectAll } from "@/api/user";
|
||||
import { mul, add } from "@/utils/bc";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import debounce from "lodash.debounce";
|
||||
|
||||
const CHECKED_IDS = "cart_checked";
|
||||
|
||||
|
@ -84,6 +84,14 @@
|
||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view>
|
||||
<!-- <svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-phone_" />
|
||||
</svg> -->
|
||||
<input type="text" placeholder="输入邀请码" v-model="inviteCode" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="logon" @click="register">注册</view>
|
||||
<view class="tip">
|
||||
@ -113,7 +121,9 @@
|
||||
import dayjs from "dayjs";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
|
||||
import {handleGetUserInfo} from '@/utils'
|
||||
import {
|
||||
handleGetUserInfo
|
||||
} from '@/utils'
|
||||
|
||||
const BACK_URL = "login_back_url";
|
||||
|
||||
@ -127,6 +137,7 @@ import {handleGetUserInfo} from '@/utils'
|
||||
account: "",
|
||||
password: "",
|
||||
captcha: "",
|
||||
inviteCode:"",
|
||||
formItem: 1,
|
||||
type: "login"
|
||||
};
|
||||
@ -211,6 +222,7 @@ import {handleGetUserInfo} from '@/utils'
|
||||
account: that.account,
|
||||
captcha: that.captcha,
|
||||
password: that.password,
|
||||
inviteCode: that.inviteCode,
|
||||
spread: cookie.get("spread")
|
||||
})
|
||||
.then(res => {
|
||||
|
@ -119,6 +119,14 @@
|
||||
<view class="by">
|
||||
<text class="by-text">By@意象</text>
|
||||
</view>
|
||||
<view class="by">
|
||||
<view>
|
||||
<text class="by-text">Copyright © 2020</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="by-text">漯河市大有前途网络科技有限公司</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-line-height"></view>
|
||||
<!-- <SwitchWindow
|
||||
v-on:changeswitch="changeswitch"
|
||||
@ -296,6 +304,7 @@
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.$store.getters.token)
|
||||
console.log(this.userInfo);
|
||||
if (this.$store.getters.token) {
|
||||
this.User();
|
||||
|
@ -14,8 +14,8 @@
|
||||
<view class="condition line1">购物满{{ item.useMinPrice }}元可用</view>
|
||||
<view class="data acea-row row-between-wrapper">
|
||||
<view v-if="item.endTime !== 0">
|
||||
<data-format-t :data="item.startTime"></data-format-t>-
|
||||
<data-format-t :data="item.endTime"></data-format-t>
|
||||
<data-format-t :date="item.startTime"></data-format-t>-
|
||||
<data-format-t :date="item.endTime"></data-format-t>
|
||||
</view>
|
||||
<view v-else>不限时</view>
|
||||
<view class="bnt gray" v-if="item.isUse === true">已领取</view>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<view class="condition line1">{{ item.couponTitle }}</view>
|
||||
<view class="data acea-row row-between-wrapper">
|
||||
<view v-if="item.endTime === 0">不限时</view>
|
||||
<view v-else><data-format-t :data="item.addTime"></data-format-t> - <data-format-t :data="item.endTime"></data-format-t></view>
|
||||
<view v-else><data-format-t :date="item.addTime"></data-format-t> - <data-format-t :date="item.endTime"></data-format-t></view>
|
||||
<view class="bnt gray" v-if="item._type === 0">{{ item._msg }}</view>
|
||||
<view class="bnt bg-color-red" v-else>{{ item._msg }}</view>
|
||||
</view>
|
||||
|
@ -14,7 +14,9 @@
|
||||
</template>
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import { getSpreadImg } from "@/api/user";
|
||||
import {
|
||||
getSpreadImg
|
||||
} from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "Poster",
|
||||
@ -59,7 +61,11 @@ export default {
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
getSpreadImg().then(
|
||||
let form = {}
|
||||
if (this.$deviceType == 'app') {
|
||||
form.form = 'app'
|
||||
}
|
||||
getSpreadImg(form).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
@ -80,8 +86,7 @@ export default {
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
|
||||
@ -132,12 +137,15 @@ export default {
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
|
@ -45,7 +45,7 @@
|
||||
<view>
|
||||
<view class="state">{{ item.title }}</view>
|
||||
<view>
|
||||
<data-format :data="item.addTime"></data-format>
|
||||
<data-format :date="item.addTime"></data-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num" v-if="item.pm == 1">+{{ item.number }}</view>
|
||||
|
@ -35,7 +35,7 @@ export function dataFormat(time, option) {
|
||||
}
|
||||
}
|
||||
|
||||
export function dataFormatT(time) {
|
||||
export function dateFormatT(time) {
|
||||
time = +time * 1000;
|
||||
const d = new Date(time);
|
||||
|
||||
@ -121,7 +121,7 @@ export const replaceLogin = (msg) => {
|
||||
// 这里代表已经失去登录状态以及401强制推出登录了
|
||||
store.commit('LOGOUT')
|
||||
console.log(uni, 989)
|
||||
if (Vue.prototype.$deviceType == 'Weixin') {
|
||||
if (Vue.prototype.$deviceType == 'weixin') {
|
||||
// 如果是微信小程序,跳转到授权页
|
||||
replace({
|
||||
path: '/pages/authorization/index',
|
||||
@ -199,7 +199,7 @@ export const login = (option) => {
|
||||
console.log(user)
|
||||
console.log(`用户昵称为 | ${user.userInfo.nickName}`);
|
||||
console.log(`当前的环境 | ${Vue.prototype.$deviceType}`)
|
||||
if (Vue.prototype.$deviceType == 'Weixin') {
|
||||
if (Vue.prototype.$deviceType == 'weixin') {
|
||||
wxappAuth({
|
||||
encryptedData: user.encryptedData,
|
||||
iv: user.iv,
|
||||
|
@ -44,6 +44,8 @@ function baseRequest(options) {
|
||||
return fly.request(url, params || data, {
|
||||
...option
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
console.log(url,params,data, ...option)
|
||||
const data = res.data || {};
|
||||
if (res.status !== 200)
|
||||
return Promise.reject({ msg: "请求失败", res, data });
|
||||
|
Reference in New Issue
Block a user