Browse Source

修改小程序与app的兼容文件

master
gaoxs 5 years ago
parent
commit
57ae931f2d
  1. 1
      App.vue
  2. 29
      api/order.js
  3. 62
      api/store.js
  4. 92
      api/user.js
  5. 5
      assets/css/style.less
  6. 2
      components/CouponListWindow.vue
  7. 8
      components/DataFormat.vue
  8. 10
      components/DataFormatT.vue
  9. 1
      libs/wechat.js
  10. 10
      main.js
  11. 22
      manifest.json
  12. 2
      pages/Loading/index.vue
  13. 5
      pages/authorization/index.vue
  14. 1
      pages/home/index.vue
  15. 4
      pages/order/MyOrder/index.vue
  16. 4
      pages/order/OrderDetails/index.vue
  17. 25
      pages/order/OrderSubmission/index.vue
  18. 4
      pages/orderAdmin/AdminOrder/index.vue
  19. 2
      pages/orderAdmin/AdminOrderList/index.vue
  20. 1
      pages/shop/GoodsClass/index.vue
  21. 239
      pages/shop/GoodsCon/index.vue
  22. 1
      pages/shop/GoodsList/index.vue
  23. 1
      pages/shop/ShoppingCart/index.vue
  24. 14
      pages/user/Login/index.vue
  25. 9
      pages/user/User/index.vue
  26. 4
      pages/user/coupon/GetCoupon/index.vue
  27. 2
      pages/user/coupon/UserCoupon/index.vue
  28. 38
      pages/user/promotion/Poster/index.vue
  29. 2
      pages/user/signIn/Integral/index.vue
  30. 6
      utils/index.js
  31. 2
      utils/request.js

1
App.vue

@ -16,6 +16,7 @@
<style lang="less"> <style lang="less">
/*每个页面公共css */ /*每个页面公共css */
@import "animate.css";
@import "./assets/iconfont/iconfont.css"; @import "./assets/iconfont/iconfont.css";
@import "./assets/css/base.less"; @import "./assets/css/base.less";
@import "./assets/css/reset.less"; @import "./assets/css/reset.less";

29
api/order.js

@ -9,7 +9,9 @@ import request from "@/utils/request";
* @returns {*} * @returns {*}
*/ */
export function postOrderConfirm(cartId) { 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 {*} * @returns {*}
*/ */
export function cancelOrder(id) { 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 {*} * @returns {*}
*/ */
export function takeOrder(uni) { 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 {*} * @returns {*}
*/ */
export function delOrder(uni) { export function delOrder(uni) {
return request.post("/order/del", { uni }); return request.post("/order/del", {
uni
});
} }
/** /**
@ -110,7 +118,7 @@ export function delOrder(uni) {
* @returns {*} * @returns {*}
*/ */
export function express(params) { export function express(params) {
return request.post("order/express",params); return request.post("order/express", params);
} }
/** /**
@ -118,12 +126,19 @@ export function express(params) {
* @returns {*} * @returns {*}
*/ */
export function payOrder(uni, paytype, from) { export function payOrder(uni, paytype, from) {
return request.post("order/pay", { uni, paytype, from }); return request.post("order/pay", {
uni,
paytype,
from
});
} }
/** /**
* 订单核销 * 订单核销
* @returns {*} * @returns {*}
*/ */
export function orderVerific(verify_code, is_confirm) { 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

@ -4,28 +4,36 @@ import request from "@/utils/request";
* 商品分类 * 商品分类
* */ * */
export function getCategory() { export function getCategory() {
return request.get("/category", {}, { login: false }); return request.get("/category", {}, {
login: false
});
} }
/* /*
* 商品详情 * 商品详情
* */ * */
export function getProductDetail(id) { export function getProductDetail(id, data) {
return request.get("/product/detail/" + id, {}, { login: true }); return request.get("/product/detail/" + id, data, {
login: true
});
} }
/* /*
* 商品分销二维码 * 商品分销二维码
* */ * */
export function getProductCode(id) { export function getProductCode(id) {
return request.get("/product/code/" + id, {}, { login: true }); return request.get("/product/code/" + id, {}, {
login: true
});
} }
/* /*
* 商品列表 * 商品列表
* */ * */
export function getProducts(q) { 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) { export function getHostProducts(page, limit) {
return request.get( return request.get(
"/product/hot", "/product/hot", {
{ page: page, limit: limit }, page: page,
{ login: false } limit: limit
}, {
login: false
}
); );
} }
@ -57,7 +68,9 @@ export function getHostProducts(page, limit) {
* 精品热门首发列表 * 精品热门首发列表
* */ * */
export function getGroomList(type) { 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) { 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) { export function changeCartNum(id, number) {
return request.post("/cart/num", { id, number }); return request.post("/cart/num", {
id,
number
});
} }
/** /**
* 搜索推荐关键字 * 搜索推荐关键字
*/ */
export function getSearchKeyword() { export function getSearchKeyword() {
return request.get("/search/keyword", {}, { login: false }); return request.get("/search/keyword", {}, {
login: false
});
} }
/** /**
* 产品评论列表 * 产品评论列表
*/ */
export function getReplyList(id, q) { 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) { export function getReplyConfig(id) {
return request.get("/reply/config/" + id, {}, { login: true }); return request.get("/reply/config/" + id, {}, {
login: true
});
} }
/** /**
* 评价页面获取单个产品详情 * 评价页面获取单个产品详情
*/ */
export function postOrderProduct(unique) { export function postOrderProduct(unique) {
return request.post("/order/product", { unique }, { login: true }); return request.post("/order/product", {
unique
}, {
login: true
});
} }
/** /**
* 提交评价页面 * 提交评价页面
*/ */
export function postOrderComment(data) { export function postOrderComment(data) {
return request.post("/order/comment", data, { login: true }); return request.post("/order/comment", data, {
login: true
});
} }

92
api/user.js

@ -4,7 +4,9 @@ import request from "@/utils/request";
* 省市区 * 省市区
*/ */
export function district(data) { 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 用户账号密码 * @param data object 用户账号密码
*/ */
export function login(data) { 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 用户手机号 也只能 * @param data object 用户手机号 也只能
*/ */
export function loginMobile(data) { 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 用户手机号 * @param data object 用户手机号
*/ */
export function registerVerify(data) { 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 用户手机号 验证码 密码 * @param data object 用户手机号 验证码 密码
*/ */
export function register(data) { 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 用户手机号 验证码 密码 * @param data object 用户手机号 验证码 密码
*/ */
export function registerReset(data) { export function registerReset(data) {
return request.post("/register/reset", data, { login: false }); return request.post("/register/reset", data, {
login: false
});
} }
/* /*
* 领取优惠券列表 * 领取优惠券列表
* */ * */
export function getCoupon(q) { export function getCoupon(q) {
return request.get("/coupons", q, { login: true }); return request.get("/coupons", q, {
login: true
});
} }
/* /*
* 点击领取优惠券 * 点击领取优惠券
* */ * */
export function getCouponReceive(id) { 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) { 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() { 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) { 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) { export function getAddressRemove(id) {
return request.post("/address/del", { id: id }); return request.post("/address/del", {
id: id
});
} }
/* /*
* 设置默认地址 * 设置默认地址
* */ * */
export function getAddressDefaultSet(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) { 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) { 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) { 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) { 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) { 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() { export function getActivityStatus() {
return request.get("/user/activity", {}, { login: false }); return request.get("/user/activity", {}, {
login: false
});
} }
/* /*
* 活动状态 * 活动状态
* */ * */
export function getSpreadImg() { export function getSpreadImg(data) {
return request.get("/spread/banner");
return request.get("/spread/banner", data);
} }
/* /*
@ -340,7 +386,9 @@ export function bindingPhone(data) {
* h5切换公众号登陆 * h5切换公众号登陆
* */ * */
export function switchH5Login() { export function switchH5Login() {
return request.post("switch_h5", { from: "wechat" }); return request.post("switch_h5", {
from: "wechat"
});
} }
/* /*
* 获取推广人排行 * 获取推广人排行

5
assets/css/style.less

@ -1666,8 +1666,9 @@
.index .wrapper.hot .newProducts .newProductsItem { .index .wrapper.hot .newProducts .newProductsItem {
width: 2.4*100rpx; width: 2.4*100rpx;
min-width: 2.4*100rpx;
margin-right: 0.2*100rpx; margin-right: 0.2*100rpx;
flex: 0 2.4*100rpx;
} }
.index .wrapper .newProducts .newProductsScroll { .index .wrapper .newProducts .newProductsScroll {
@ -1683,9 +1684,11 @@
.index .wrapper .newProducts .newProductsItem { .index .wrapper .newProducts .newProductsItem {
border: 1rpx solid #eee; border: 1rpx solid #eee;
width: 2.4*100rpx; width: 2.4*100rpx;
min-width: 2.4*100rpx;
border-radius: 0.12*100rpx; border-radius: 0.12*100rpx;
overflow: hidden; overflow: hidden;
margin-right: .2*100rpx; margin-right: .2*100rpx;
flex: 0 2.4*100rpx;
} }
.index .wrapper .newProducts:nth-last-child(1) {} .index .wrapper .newProducts:nth-last-child(1) {}

2
components/CouponListWindow.vue

@ -21,7 +21,7 @@
<view class="condition line1">{{ coupon.couponTitle }}</view> <view class="condition line1">{{ coupon.couponTitle }}</view>
<view class="data acea-row row-between-wrapper"> <view class="data acea-row row-between-wrapper">
<view v-if="coupon.endTime === 0">不限时</view> <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 <view
class="iconfont icon-xuanzhong1 font-color-red" class="iconfont icon-xuanzhong1 font-color-red"
v-if="checked === coupon.id" v-if="checked === coupon.id"

8
components/DataFormat.vue

@ -6,18 +6,18 @@ import { dataFormat } from "@/utils";
export default { export default {
name: "DataFormat", name: "DataFormat",
props: ["data"], props: ["date"],
data: function() { data: function() {
return { return {
time: "" time: ""
}; };
}, },
mounted() { mounted() {
this.time = dataFormat(this.data); this.time = dataFormat(this.date);
}, },
watch: { watch: {
"$props.data"(props) { "$props.date"(props) {
this.time = dataFormat(this.data); this.time = dataFormat(this.date);
} }
} }
}; };

10
components/DataFormatT.vue

@ -2,22 +2,22 @@
<text>{{time}}</text> <text>{{time}}</text>
</template> </template>
<script> <script>
import { dataFormatT } from "@/utils"; import { dateFormatT } from "@/utils";
export default { export default {
name: "DataFormatT", name: "DataFormatT",
props: ["data"], props: ["date"],
data: function() { data: function() {
return { return {
time: "" time: ""
}; };
}, },
mounted() { mounted() {
this.time = dataFormatT(this.data); this.time = dateFormatT(this.date);
}, },
watch: { watch: {
"$props.data"(props) { "$props.date"(props) {
this.time = dataFormatT(this.data); this.time = dateFormatT(this.date);
} }
} }
}; };

1
libs/wechat.js

@ -2,6 +2,7 @@
export const weappPay = (option) => { export const weappPay = (option) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 吊起微信支付 // 吊起微信支付
console.log(option,9999)
uni.requestPayment({ uni.requestPayment({
...option, ...option,
timeStamp: option.timeStamp + '', timeStamp: option.timeStamp + '',

10
main.js

@ -3,7 +3,6 @@ import App from './App'
// import router from "./router"; // import router from "./router";
import store from "./store"; import store from "./store";
import animate from "animate.css";
import schema from "async-validator"; import schema from "async-validator";
import dialog from "./utils/dialog"; import dialog from "./utils/dialog";
import cookie from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
@ -25,7 +24,6 @@ import {
VUE_APP_API_URL VUE_APP_API_URL
} from "@/config"; } from "@/config";
Vue.use(animate);
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.config.devtools = process.env.NODE_ENV !== "production"; Vue.config.devtools = process.env.NODE_ENV !== "production";
@ -82,24 +80,24 @@ Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
// #ifdef H5 // #ifdef H5
// H5编译的代码 // H5编译的代码
Vue.prototype.$deviceType = 'H5' Vue.prototype.$deviceType = 'h5'
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
// App平台编译的代码 // App平台编译的代码
Vue.prototype.$deviceType = 'App' Vue.prototype.$deviceType = 'app'
Vue.prototype.$platform = uni.getSystemInfoSync().platform Vue.prototype.$platform = uni.getSystemInfoSync().platform
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// 微信小程序编译的代码 // 微信小程序编译的代码
Vue.prototype.$deviceType = 'Weixin' Vue.prototype.$deviceType = 'weixin'
// #endif // #endif
console.log(wx,121212) console.log(wx,121212)
console.log(Vue.prototype.$deviceType) console.log(Vue.prototype.$deviceType)
// if(wx){ // if(wx){
// Vue.prototype.$deviceType = 'Weixin' // Vue.prototype.$deviceType = 'weixin'
// } // }
app.$mount() app.$mount()

22
manifest.json

@ -54,7 +54,27 @@
/* ios */ /* ios */
"ios" : {}, "ios" : {},
/* SDK */ /* SDK */
"sdkConfigs" : {} "sdkConfigs" : {
"oauth" : {
"weixin" : {
"appid" : "",
"appsecret" : "",
"UniversalLinks" : ""
}
},
"payment" : {
"weixin" : {
"appid" : "",
"UniversalLinks" : ""
}
},
"share" : {
"weixin" : {
"appid" : "",
"UniversalLinks" : ""
}
}
}
} }
}, },
/* */ /* */

2
pages/Loading/index.vue

@ -45,7 +45,7 @@ export default {
console.log(this.$store.getters.userInfo, '获取store里面的 userInfo'); console.log(this.$store.getters.userInfo, '获取store里面的 userInfo');
cookie.get("spread"); cookie.get("spread");
// this.toLaunch(); // this.toLaunch();
if (this.$deviceType == 'App') { if (this.$deviceType == 'app') {
// this.toLaunch(); // this.toLaunch();
this.$yrouter.switchTab({ this.$yrouter.switchTab({
path: '/pages/home/index', path: '/pages/home/index',

5
pages/authorization/index.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="container"> <view class="container">
<view v-if="!$store.getters.token&&$deviceType=='Weixin'"> <view v-if="!$store.getters.token&&$deviceType=='weixin'">
<view class="getUserInfo"> <view class="getUserInfo">
<text>您还未允许微信登录授权请点击下方按钮允许微信授权登录</text> <text>您还未允许微信登录授权请点击下方按钮允许微信授权登录</text>
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button> <button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button>
@ -8,7 +8,7 @@
<button @click="back">取消微信登录授权</button> <button @click="back">取消微信登录授权</button>
</view> </view>
</view> </view>
<view v-if="!$store.getters.token&&$deviceType!='Weixin'"> <view v-if="!$store.getters.token&&$deviceType!='weixin'&&$deviceType=='app'">
<view class="getUserInfo"> <view class="getUserInfo">
<text>请先登录</text> <text>请先登录</text>
<button type="primary" @click="this.toLogin">去登录</button> <button type="primary" @click="this.toLogin">去登录</button>
@ -43,6 +43,7 @@
...mapState(["isAuthorization"]) ...mapState(["isAuthorization"])
}, },
onShow() { onShow() {
this.UPDATE_AUTHORIZATIONPAGE(true); this.UPDATE_AUTHORIZATIONPAGE(true);
}, },
onHide() { onHide() {

1
pages/home/index.vue

@ -290,6 +290,7 @@ export default {
}); });
}, },
goGoodsCon(item) { goGoodsCon(item) {
console.log(item)
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/shop/GoodsCon/index", path: "/pages/shop/GoodsCon/index",
query: { id: item.id } query: { id: item.id }

4
pages/order/MyOrder/index.vue

@ -44,7 +44,7 @@
>拼团</text> >拼团</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.seckillId > 0">秒杀</text>
<text class="sign cart-color acea-row row-center-wrapper" v-if="order.bargainId > 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>
<view class="font-color-red">{{ getStatus(order) }}</view> <view class="font-color-red">{{ getStatus(order) }}</view>
</view> </view>
@ -209,7 +209,7 @@ export default {
orderList: [], orderList: [],
pay: false, pay: false,
payType: ["yue", "weixin"], payType: ["yue", "weixin"],
from: isWeixin() ? "weixin" : "weixinh5" from: this.$deviceType
}; };
}, },
components: { components: {

4
pages/order/OrderDetails/index.vue

@ -5,7 +5,7 @@
<view class="data" :class="refundOrder ? 'on' : ''"> <view class="data" :class="refundOrder ? 'on' : ''">
<view class="state">{{ orderInfo._status._msg }}</view> <view class="state">{{ orderInfo._status._msg }}</view>
<view> <view>
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</view> </view>
</view> </view>
</view> </view>
@ -144,7 +144,7 @@
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>下单时间</view> <view>下单时间</view>
<view class="conter"> <view class="conter">
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</view> </view>
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">

25
pages/order/OrderSubmission/index.vue

@ -481,6 +481,26 @@
uni.showLoading({ uni.showLoading({
title: "生成订单中" 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, { createOrder(this.orderGroupInfo.orderKey, {
realName: this.contacts, realName: this.contacts,
phone: this.contactsTel, phone: this.contactsTel,
@ -494,9 +514,11 @@
bargainId: this.orderGroupInfo.bargain_id, bargainId: this.orderGroupInfo.bargain_id,
from: this.from, from: this.from,
mark: this.mark || "", mark: this.mark || "",
shippingType: parseInt(shipping_type) + 1 shippingType: parseInt(shipping_type) + 1,
...form
}) })
.then(res => { .then(res => {
console.log(res)
uni.hideLoading(); uni.hideLoading();
const data = res.data; const data = res.data;
switch (data.status) { switch (data.status) {
@ -542,6 +564,7 @@
break; break;
case "WECHAT_PAY": case "WECHAT_PAY":
weappPay(data.result.jsConfig).then(res => { weappPay(data.result.jsConfig).then(res => {
console.log(res)
this.$yrouter.replace({ this.$yrouter.replace({
path: "/pages/order/OrderDetails/index", path: "/pages/order/OrderDetails/index",
query: { query: {

4
pages/orderAdmin/AdminOrder/index.vue

@ -6,7 +6,7 @@
<view class="order-num">订单{{ orderInfo.orderId }}</view> <view class="order-num">订单{{ orderInfo.orderId }}</view>
<view> <view>
<text class="time"> <text class="time">
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</text> </text>
</view> </view>
</view> </view>
@ -67,7 +67,7 @@
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>下单时间</view> <view>下单时间</view>
<view class="conter"> <view class="conter">
<data-format :data="orderInfo.addTime"></data-format> <data-format :date="orderInfo.addTime"></data-format>
</view> </view>
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">

2
pages/orderAdmin/AdminOrderList/index.vue

@ -14,7 +14,7 @@
<text>订单号{{ item.orderId }}</text> <text>订单号{{ item.orderId }}</text>
<text class="time"> <text class="time">
<text>下单时间</text> <text>下单时间</text>
<data-format :data="item.addTime"></data-format> <data-format :date="item.addTime"></data-format>
</text> </text>
</view> </view>
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key"> <view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">

1
pages/shop/GoodsClass/index.vue

@ -47,7 +47,6 @@
</view> </view>
</template> </template>
<script> <script>
import debounce from "lodash.debounce";
import { getCategory } from "@/api/store"; import { getCategory } from "@/api/store";
import { trim } from "@/utils"; import { trim } from "@/utils";

239
pages/shop/GoodsCon/index.vue

@ -6,15 +6,8 @@
<view class="money font-color-red"> <view class="money font-color-red">
<text></text> <text></text>
<text class="num">{{ storeInfo.price }}</text> <text class="num">{{ storeInfo.price }}</text>
<text <text class="vip-money" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">{{ storeInfo.vipPrice }}</text>
class="vip-money" <image :src="$VUE_APP_RESOURCES_URL+'/images/vip.png'" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
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>
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view> <view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
</view> </view>
@ -27,11 +20,7 @@
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length"> <view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
<text class="hide line1 acea-row"> <text class="hide line1 acea-row">
<text>优惠券</text> <text>优惠券</text>
<text <text class="activity" v-for="(item, couponListEq) in couponList" :key="couponListEq">{{ item.use_min_price }}{{ item.coupon_price }}</text>
class="activity"
v-for="(item, couponListEq) in couponList"
:key="couponListEq"
>{{ item.use_min_price }}{{ item.coupon_price }}</text>
</text> </text>
<view class="iconfont icon-jiantou"></view> <view class="iconfont icon-jiantou"></view>
</view> </view>
@ -110,11 +99,7 @@
<view class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view> <view class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
<text>收藏</text> <text>收藏</text>
</view> </view>
<view <view @click="goShoppingCart()" class="item animated" :class="animated === true ? 'bounceIn' : ''">
@click="goShoppingCart()"
class="item animated"
:class="animated === true ? 'bounceIn' : ''"
>
<view class="iconfont icon-gouwuche1"> <view class="iconfont icon-gouwuche1">
<text class="num bg-color-red" v-if="CartCount > 0">{{CartCount}}</text> <text class="num bg-color-red" v-if="CartCount > 0">{{CartCount}}</text>
</view> </view>
@ -131,11 +116,7 @@
</view> </view>
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop> <CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow> <ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
<StorePoster <StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus" :posterData="posterData"></StorePoster>
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo> <ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''"> <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<view class="item" v-if="weixinStatus === true" @click="setShareInfoStatus"> <view class="item" v-if="weixinStatus === true" @click="setShareInfoStatus">
@ -149,44 +130,46 @@
</view> </view>
<view class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></view> <view class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></view>
<view class="geoPage" v-if="mapShow"> <view class="geoPage" v-if="mapShow">
<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>
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>
</view> </view>
</template> </template>
<script> <script>
// import { swiper, swiperSlide } from "vue-awesome-swiper"; // import { swiper, swiperSlide } from "vue-awesome-swiper";
import ProductConSwiper from "@/components/ProductConSwiper"; import ProductConSwiper from "@/components/ProductConSwiper";
import UserEvaluation from "@/components/UserEvaluation"; import UserEvaluation from "@/components/UserEvaluation";
import CouponPop from "@/components/CouponPop"; import CouponPop from "@/components/CouponPop";
import ProductWindow from "@/components/ProductWindow"; import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster"; import StorePoster from "@/components/StorePoster";
import ShareInfo from "@/components/ShareInfo"; import ShareInfo from "@/components/ShareInfo";
import { import {
getProductDetail, getProductDetail,
postCartAdd, postCartAdd,
getCartCount, getCartCount,
getProductCode getProductCode
} from "@/api/store"; } from "@/api/store";
import { import {
getCoupon, getCoupon,
getCollectAdd, getCollectAdd,
getCollectDel, getCollectDel,
getUserInfo getUserInfo
} from "@/api/user"; } from "@/api/user";
import { isWeixin, PosterCanvas, handleQrCode } from "@/utils"; import {
// import { wechatEvevt } from "@/libs/wechat"; isWeixin,
import { imageBase64 } from "@/api/public"; PosterCanvas,
import { mapGetters } from "vuex"; handleQrCode
} from "@/utils";
export default { // import { wechatEvevt } from "@/libs/wechat";
import {
imageBase64
} from "@/api/public";
import {
mapGetters
} from "vuex";
export default {
name: "GoodsCon", name: "GoodsCon",
components: { components: {
// swiper, // swiper,
@ -254,12 +237,13 @@ export default {
}, },
computed: mapGetters(["isLogin"]), computed: mapGetters(["isLogin"]),
mounted: function() { mounted: function() {
console.log(this)
let url = handleQrCode(); let url = handleQrCode();
console.log(url); console.log(url);
if (url && url.productId) { if (url && url.productId) {
this.id = url.productId; this.id = url.productId;
} else { } else {
this.id = this.$yroute.query.id; this.id = this._route.query.id;
} }
this.productCon(); this.productCon();
}, },
@ -321,7 +305,12 @@ export default {
// //
productCon: function() { productCon: function() {
let that = this; 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 => { .then(res => {
that.$set(that, "storeInfo", res.data.storeInfo); that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that.attr, "productAttr", res.data.productAttr); that.$set(that.attr, "productAttr", res.data.productAttr);
@ -580,10 +569,8 @@ export default {
productId: that.id, productId: that.id,
cartNum: that.attr.productSelect.cart_num, cartNum: that.attr.productSelect.cart_num,
new: news, new: news,
uniqueId: uniqueId: that.attr.productSelect !== undefined ?
that.attr.productSelect !== undefined that.attr.productSelect.unique : ""
? that.attr.productSelect.unique
: ""
}; };
postCartAdd(q) postCartAdd(q)
.then(function(res) { .then(function(res) {
@ -650,97 +637,97 @@ export default {
this.posters = false; this.posters = false;
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.geoPage { .geoPage {
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%; height: 100%;
top: 0; top: 0;
z-index: 10000; z-index: 10000;
} }
.product-con .store-info { .product-con .store-info {
margin-top: 0.2*100rpx; margin-top: 0.2*100rpx;
background-color: #fff; background-color: #fff;
} }
.product-con .store-info .title { .product-con .store-info .title {
padding: 0 0.3*100rpx; padding: 0 0.3*100rpx;
font-size: 0.28*100rpx; font-size: 0.28*100rpx;
color: #282828; color: #282828;
height: 0.8*100rpx; height: 0.8*100rpx;
line-height: 0.8*100rpx; line-height: 0.8*100rpx;
border-bottom: 0.01*100rpx solid #f5f5f5; border-bottom: 0.01*100rpx solid #f5f5f5;
} }
.product-con .store-info .info { .product-con .store-info .info {
padding: 0 0.3*100rpx; padding: 0 0.3*100rpx;
height: 1.26*100rpx; height: 1.26*100rpx;
} }
.product-con .store-info .info .picTxt { .product-con .store-info .info .picTxt {
width: 6.15*100rpx; width: 6.15*100rpx;
} }
.product-con .store-info .info .picTxt .pictrue { .product-con .store-info .info .picTxt .pictrue {
width: 0.76*100rpx; width: 0.76*100rpx;
height: 0.76*100rpx; height: 0.76*100rpx;
} }
.product-con .store-info .info .picTxt .pictrue image { .product-con .store-info .info .picTxt .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.06*100rpx; border-radius: 0.06*100rpx;
} }
.product-con .store-info .info .picTxt .text { .product-con .store-info .info .picTxt .text {
width: 5.22*100rpx; width: 5.22*100rpx;
} }
.product-con .store-info .info .picTxt .text .name { .product-con .store-info .info .picTxt .text .name {
font-size: 0.3*100rpx; font-size: 0.3*100rpx;
color: #282828; color: #282828;
} }
.product-con .store-info .info .picTxt .text .address { .product-con .store-info .info .picTxt .text .address {
font-size: 0.24*100rpx; font-size: 0.24*100rpx;
color: #666; color: #666;
margin-top: 0.03*100rpx; margin-top: 0.03*100rpx;
} }
.product-con .store-info .info .picTxt .text .address .iconfont { .product-con .store-info .info .picTxt .text .address .iconfont {
color: #707070; color: #707070;
font-size: 0.18*100rpx; font-size: 0.18*100rpx;
margin-left: 0.1*100rpx; margin-left: 0.1*100rpx;
} }
.product-con .store-info .info .picTxt .text .address .addressTxt { .product-con .store-info .info .picTxt .text .address .addressTxt {
width: 4.8*100rpx; width: 4.8*100rpx;
} }
.product-con .store-info .info .iconfont { .product-con .store-info .info .iconfont {
font-size: 0.4*100rpx; font-size: 0.4*100rpx;
} }
.product-con .superior { .product-con .superior {
background-color: #fff; background-color: #fff;
margin-top: 0.2*100rpx; margin-top: 0.2*100rpx;
} }
.product-con .superior .title { .product-con .superior .title {
height: 0.98*100rpx; height: 0.98*100rpx;
} }
.product-con .superior .title image { .product-con .superior .title image {
width: 0.3*100rpx; width: 0.3*100rpx;
height: 0.3*100rpx; height: 0.3*100rpx;
} }
.product-con .superior .title .titleTxt { .product-con .superior .title .titleTxt {
margin: 0 0.2*100rpx; margin: 0 0.2*100rpx;
font-size: 0.3*100rpx; font-size: 0.3*100rpx;
background-image: linear-gradient(to right, #f57a37 0%, #f21b07 100%); background-image: linear-gradient(to right, #f57a37 0%, #f21b07 100%);
@ -748,69 +735,69 @@ export default {
background-image: -moz-linear-gradient(to right, #f57a37 0%, #f21b07 100%); background-image: -moz-linear-gradient(to right, #f57a37 0%, #f21b07 100%);
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
.product-con .superior .slider-banner { .product-con .superior .slider-banner {
width: 6.9*100rpx; width: 6.9*100rpx;
margin: 0 auto; margin: 0 auto;
padding-bottom: 0.2*100rpx; padding-bottom: 0.2*100rpx;
} }
.product-con .superior .slider-banner .list { .product-con .superior .slider-banner .list {
width: 100%; width: 100%;
padding-bottom: 0.2*100rpx; padding-bottom: 0.2*100rpx;
} }
.product-con .superior .slider-banner .list .item { .product-con .superior .slider-banner .list .item {
width: 2.15*100rpx; width: 2.15*100rpx;
margin: 0 0.22*100rpx 0.3*100rpx 0; margin: 0 0.22*100rpx 0.3*100rpx 0;
font-size: 0.26*100rpx; font-size: 0.26*100rpx;
} }
.product-con .superior .slider-banner .list .item:nth-of-type(3n) { .product-con .superior .slider-banner .list .item:nth-of-type(3n) {
margin-right: 0; margin-right: 0;
} }
.product-con .superior .slider-banner .list .item .pictrue { .product-con .superior .slider-banner .list .item .pictrue {
width: 100%; width: 100%;
height: 2.15*100rpx; height: 2.15*100rpx;
} }
.product-con .superior .slider-banner .list .item .pictrue image { .product-con .superior .slider-banner .list .item .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.06*100rpx; border-radius: 0.06*100rpx;
} }
.product-con .superior .slider-banner .list .item .name { .product-con .superior .slider-banner .list .item .name {
color: #282828; color: #282828;
margin-top: 0.12*100rpx; margin-top: 0.12*100rpx;
} }
.product-con .superior .slider-banner .swiper-pagination-bullet { .product-con .superior .slider-banner .swiper-pagination-bullet {
background-color: #999; background-color: #999;
} }
.product-con .superior .slider-banner .swiper-pagination-bullet-active { .product-con .superior .slider-banner .swiper-pagination-bullet-active {
background-color: #e93323; background-color: #e93323;
} }
.mask { .mask {
-webkit-filter: blur(2px); -webkit-filter: blur(2px);
-moz-filter: blur(2px); -moz-filter: blur(2px);
-ms-filter: blur(2px); -ms-filter: blur(2px);
filter: blur(2px); filter: blur(2px);
} }
.footer .icon-shoucang1 { .footer .icon-shoucang1 {
color: #73cbb6; color: #73cbb6;
} }
.product-con .product-intro .conter view { .product-con .product-intro .conter view {
width: 100% !important; width: 100% !important;
} }
.generate-posters { .generate-posters {
width: 100%; width: 100%;
height: 1.7*100rpx; height: 1.7*100rpx;
background-color: #fff; background-color: #fff;
@ -827,34 +814,34 @@ export default {
-webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); -webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
-moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); -moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
-o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); -o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
} }
.generate-posters.on { .generate-posters.on {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0);
} }
.generate-posters .item { .generate-posters .item {
flex: 50%; flex: 50%;
-webkit-flex: 50%; -webkit-flex: 50%;
-ms-flex: 50%; -ms-flex: 50%;
text-align: center; text-align: center;
} }
.generate-posters .item .iconfont { .generate-posters .item .iconfont {
font-size: 0.8*100rpx; font-size: 0.8*100rpx;
color: #5eae72; color: #5eae72;
} }
.generate-posters .item .iconfont.icon-haibao { .generate-posters .item .iconfont.icon-haibao {
color: #5391f1; color: #5391f1;
} }
.noscroll { .noscroll {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
</style> </style>

1
pages/shop/GoodsList/index.vue

@ -79,7 +79,6 @@
<script> <script>
import Recommend from "@/components/Recommend"; import Recommend from "@/components/Recommend";
import { getProducts } from "@/api/store"; import { getProducts } from "@/api/store";
import debounce from "lodash.debounce";
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
export default { export default {

1
pages/shop/ShoppingCart/index.vue

@ -177,7 +177,6 @@ import {
import { postCollectAll } from "@/api/user"; import { postCollectAll } from "@/api/user";
import { mul, add } from "@/utils/bc"; import { mul, add } from "@/utils/bc";
import cookie from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
import debounce from "lodash.debounce";
const CHECKED_IDS = "cart_checked"; const CHECKED_IDS = "cart_checked";

14
pages/user/Login/index.vue

@ -84,6 +84,14 @@
<input type="password" placeholder="填写您的登录密码" v-model="password" /> <input type="password" placeholder="填写您的登录密码" v-model="password" />
</view> </view>
</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>
<view class="logon" @click="register">注册</view> <view class="logon" @click="register">注册</view>
<view class="tip"> <view class="tip">
@ -113,7 +121,9 @@
import dayjs from "dayjs"; import dayjs from "dayjs";
import cookie from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
import {handleGetUserInfo} from '@/utils' import {
handleGetUserInfo
} from '@/utils'
const BACK_URL = "login_back_url"; const BACK_URL = "login_back_url";
@ -127,6 +137,7 @@ import {handleGetUserInfo} from '@/utils'
account: "", account: "",
password: "", password: "",
captcha: "", captcha: "",
inviteCode:"",
formItem: 1, formItem: 1,
type: "login" type: "login"
}; };
@ -211,6 +222,7 @@ import {handleGetUserInfo} from '@/utils'
account: that.account, account: that.account,
captcha: that.captcha, captcha: that.captcha,
password: that.password, password: that.password,
inviteCode: that.inviteCode,
spread: cookie.get("spread") spread: cookie.get("spread")
}) })
.then(res => { .then(res => {

9
pages/user/User/index.vue

@ -119,6 +119,14 @@
<view class="by"> <view class="by">
<text class="by-text">By@意象</text> <text class="by-text">By@意象</text>
</view> </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> <view class="footer-line-height"></view>
<!-- <SwitchWindow <!-- <SwitchWindow
v-on:changeswitch="changeswitch" v-on:changeswitch="changeswitch"
@ -296,6 +304,7 @@
} }
}, },
onShow() { onShow() {
console.log(this.$store.getters.token)
console.log(this.userInfo); console.log(this.userInfo);
if (this.$store.getters.token) { if (this.$store.getters.token) {
this.User(); this.User();

4
pages/user/coupon/GetCoupon/index.vue

@ -14,8 +14,8 @@
<view class="condition line1">购物满{{ item.useMinPrice }}元可用</view> <view class="condition line1">购物满{{ item.useMinPrice }}元可用</view>
<view class="data acea-row row-between-wrapper"> <view class="data acea-row row-between-wrapper">
<view v-if="item.endTime !== 0"> <view v-if="item.endTime !== 0">
<data-format-t :data="item.startTime"></data-format-t>- <data-format-t :date="item.startTime"></data-format-t>-
<data-format-t :data="item.endTime"></data-format-t> <data-format-t :date="item.endTime"></data-format-t>
</view> </view>
<view v-else>不限时</view> <view v-else>不限时</view>
<view class="bnt gray" v-if="item.isUse === true">已领取</view> <view class="bnt gray" v-if="item.isUse === true">已领取</view>

2
pages/user/coupon/UserCoupon/index.vue

@ -13,7 +13,7 @@
<view class="condition line1">{{ item.couponTitle }}</view> <view class="condition line1">{{ item.couponTitle }}</view>
<view class="data acea-row row-between-wrapper"> <view class="data acea-row row-between-wrapper">
<view v-if="item.endTime === 0">不限时</view> <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 gray" v-if="item._type === 0">{{ item._msg }}</view>
<view class="bnt bg-color-red" v-else>{{ item._msg }}</view> <view class="bnt bg-color-red" v-else>{{ item._msg }}</view>
</view> </view>

38
pages/user/promotion/Poster/index.vue

@ -13,10 +13,12 @@
</view> </view>
</template> </template>
<script> <script>
// import { swiper, swiperSlide } from "vue-awesome-swiper"; // import { swiper, swiperSlide } from "vue-awesome-swiper";
import { getSpreadImg } from "@/api/user"; import {
getSpreadImg
} from "@/api/user";
export default { export default {
name: "Poster", name: "Poster",
components: { components: {
// swiper, // swiper,
@ -59,7 +61,11 @@ export default {
methods: { methods: {
getIndex: function() { getIndex: function() {
let that = this; let that = this;
getSpreadImg().then( let form = {}
if (this.$deviceType == 'app') {
form.form = 'app'
}
getSpreadImg(form).then(
res => { res => {
that.info = res.data; that.info = res.data;
}, },
@ -80,8 +86,7 @@ export default {
if (!wx.saveImageToPhotosAlbum) { if (!wx.saveImageToPhotosAlbum) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
}); });
that.openDialogVisible = true; that.openDialogVisible = true;
@ -125,21 +130,24 @@ export default {
); );
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.distribution-posters { .distribution-posters {
height: 100%; height: 100%;
} }
.banenr {
.banenr {
height: 100%; height: 100%;
} }
.banner swiper {
.banner swiper {
height: 100%; height: 100%;
} }
.banner .slide-image {
.banner .slide-image {
width: 100%; width: 100%;
height: auto; height: auto;
} }
</style> </style>

2
pages/user/signIn/Integral/index.vue

@ -45,7 +45,7 @@
<view> <view>
<view class="state">{{ item.title }}</view> <view class="state">{{ item.title }}</view>
<view> <view>
<data-format :data="item.addTime"></data-format> <data-format :date="item.addTime"></data-format>
</view> </view>
</view> </view>
<view class="num" v-if="item.pm == 1">+{{ item.number }}</view> <view class="num" v-if="item.pm == 1">+{{ item.number }}</view>

6
utils/index.js

@ -35,7 +35,7 @@ export function dataFormat(time, option) {
} }
} }
export function dataFormatT(time) { export function dateFormatT(time) {
time = +time * 1000; time = +time * 1000;
const d = new Date(time); const d = new Date(time);
@ -121,7 +121,7 @@ export const replaceLogin = (msg) => {
// 这里代表已经失去登录状态以及401强制推出登录了 // 这里代表已经失去登录状态以及401强制推出登录了
store.commit('LOGOUT') store.commit('LOGOUT')
console.log(uni, 989) console.log(uni, 989)
if (Vue.prototype.$deviceType == 'Weixin') { if (Vue.prototype.$deviceType == 'weixin') {
// 如果是微信小程序,跳转到授权页 // 如果是微信小程序,跳转到授权页
replace({ replace({
path: '/pages/authorization/index', path: '/pages/authorization/index',
@ -199,7 +199,7 @@ export const login = (option) => {
console.log(user) console.log(user)
console.log(`用户昵称为 | ${user.userInfo.nickName}`); console.log(`用户昵称为 | ${user.userInfo.nickName}`);
console.log(`当前的环境 | ${Vue.prototype.$deviceType}`) console.log(`当前的环境 | ${Vue.prototype.$deviceType}`)
if (Vue.prototype.$deviceType == 'Weixin') { if (Vue.prototype.$deviceType == 'weixin') {
wxappAuth({ wxappAuth({
encryptedData: user.encryptedData, encryptedData: user.encryptedData,
iv: user.iv, iv: user.iv,

2
utils/request.js

@ -44,6 +44,8 @@ function baseRequest(options) {
return fly.request(url, params || data, { return fly.request(url, params || data, {
...option ...option
}).then(res => { }).then(res => {
console.log(res)
console.log(url,params,data, ...option)
const data = res.data || {}; const data = res.data || {};
if (res.status !== 200) if (res.status !== 200)
return Promise.reject({ msg: "请求失败", res, data }); return Promise.reject({ msg: "请求失败", res, data });

Loading…
Cancel
Save