24 changed files with 3745 additions and 2789 deletions
@ -1,8 +1,8 @@
|
||||
|
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
|
||||
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api';
|
||||
export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api'; |
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api' |
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static'; |
||||
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static' |
||||
|
@ -1,460 +1,470 @@
|
||||
{ |
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
||||
{ |
||||
"path": "pages/Loading/index", |
||||
"style": { |
||||
"navigationBarTitleText": "yshop商城" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/authorization/index", |
||||
"style": { |
||||
"navigationBarTitleText": "微信授权" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/Login/index", |
||||
"style": { |
||||
"navigationBarTitleText": "登录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/Register/index", |
||||
"style": { |
||||
"navigationBarTitleText": "注册" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/RetrievePassword/index", |
||||
"style": { |
||||
"navigationBarTitleText": "重置密码" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/launch/index", |
||||
"style": { |
||||
"navigationBarTitleText": "首页" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/home/index", |
||||
"style": { |
||||
"navigationBarTitleText": "yshop商城", |
||||
"navigationBarTextStyle": "white", |
||||
// "enablePullDownRefresh": true, |
||||
"navigationStyle": "custom" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodSearch/index", |
||||
"style": { |
||||
"navigationBarTitleText": "搜索商品" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsClass/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品分类" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/ShoppingCart/index", |
||||
"style": { |
||||
"navigationBarTitleText": "购物车" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/StoreList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/NotDefined/index", |
||||
"style": { |
||||
"navigationBarTitleText": "404" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/User/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsCollection/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品收藏" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsFoot/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的足迹" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/news/NewsDetail/index", |
||||
"style": { |
||||
"navigationBarTitleText": "新闻详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/news/NewsList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "新闻列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/EvaluateList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "评价列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsEvaluate/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品评价" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsPromotion/index", |
||||
"style": { |
||||
"navigationBarTitleText": "促销商品" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/HotNewGoods/index", |
||||
"style": { |
||||
"navigationBarTitleText": "热门商品" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsCon/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/BindingPhone/index", |
||||
"style": { |
||||
"navigationBarTitleText": "绑定手机号" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/address/AddAddress/index", |
||||
"style": { |
||||
"navigationBarTitleText": "新增收货地址" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/UserAccount/index", |
||||
"style": { |
||||
"navigationBarTitleText": "账户余额" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/address/AddressManagement/index", |
||||
"style": { |
||||
"navigationBarTitleText": "收货地址" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/Poster/index", |
||||
"style": { |
||||
"navigationBarTitleText": "推广名片" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/signIn/Sign/index", |
||||
"style": { |
||||
"navigationBarTitleText": "签到" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/signIn/SignRecord/index", |
||||
"style": { |
||||
"navigationBarTitleText": "签到记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/CashAudit/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提现结果" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/PromoterOrder/index", |
||||
"style": { |
||||
"navigationBarTitleText": "分销详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/PromoterList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "分销列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/UserPromotion/index", |
||||
"style": { |
||||
"navigationBarTitleText": "佣金" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/UserBill/index", |
||||
"style": { |
||||
"navigationBarTitleText": "账单记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/CashRecord/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提现记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/CommissionDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "佣金明细" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/signIn/Integral/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的积分" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/UserVip/index", |
||||
"style": { |
||||
"navigationBarTitleText": "用户vip" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/PersonalData/index", |
||||
"style": { |
||||
"navigationBarTitleText": "个人资料" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/coupon/UserCoupon/index", |
||||
"style": { |
||||
"navigationBarTitleText": "优惠券" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/coupon/GetCoupon/index", |
||||
"style": { |
||||
"navigationBarTitleText": "领取优惠券" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/UserCash/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提现" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/CustomerList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "客服列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/Recharge/index", |
||||
"style": { |
||||
"navigationBarTitleText": "充值" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/MyOrder/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/Logistics/index", |
||||
"style": { |
||||
"navigationBarTitleText": "查看物流" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/OrderDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "订单详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/OrderSubmission/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提交订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/PaymentStatus/index", |
||||
"style": { |
||||
"navigationBarTitleText": "支付状态" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/GoodsReturn/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品退货" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/ReturnList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "退货列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/OrderIndex/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家订单统计" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/AdminOrderList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/GoodsDeliver/index", |
||||
"style": { |
||||
"navigationBarTitleText": "发货" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/AdminOrder/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家订单列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/Statistics/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家统计数据" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/OrderCancellation/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家核销订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/Poster/index", |
||||
"style": { |
||||
"navigationBarTitleText": "推广海报" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/DargainDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "帮砍价" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GoodsBargain/index", |
||||
"style": { |
||||
"navigationBarTitleText": "砍价列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/BargainRecord/index", |
||||
"style": { |
||||
"navigationBarTitleText": "砍价记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GoodsGroup/index", |
||||
"style": { |
||||
"navigationBarTitleText": "团购商品列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GroupDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "团购商品详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GroupRule/index", |
||||
"style": { |
||||
"navigationBarTitleText": "团购规则" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GoodsSeckill/index", |
||||
"style": { |
||||
"navigationBarTitleText": "秒杀" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/SeckillDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "秒杀详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/map/index", |
||||
"style": { |
||||
"navigationBarTitleText": "地图" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/Live/LiveList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "直播列表" |
||||
} |
||||
} |
||||
], |
||||
"globalStyle": { |
||||
"navigationBarTextStyle": "black", |
||||
"navigationBarTitleText": "Yshop", |
||||
"navigationBarBackgroundColor": "#F8F8F8", |
||||
"backgroundColor": "#F8F8F8", |
||||
"navigationStyle": "default" |
||||
|
||||
}, |
||||
"tabBar": { |
||||
"color": "#282828", |
||||
"selectedColor": "#eb3729", |
||||
"borderStyle": "black", |
||||
"backgroundColor": "#ffffff", |
||||
"height": "50px", |
||||
"fontSize": "10px", |
||||
"iconWidth": "24px", |
||||
"spacing": "3px", |
||||
"list": [{ |
||||
"pagePath": "pages/home/index", |
||||
"iconPath": "static/icon-home.png", |
||||
"selectedIconPath": "static/icon-home-hot.png", |
||||
"text": "首页" |
||||
}, { |
||||
"pagePath": "pages/shop/GoodsClass/index", |
||||
"iconPath": "static/icon-class.png", |
||||
"selectedIconPath": "static/icon-class-hot.png", |
||||
"text": "分类" |
||||
}, { |
||||
"pagePath": "pages/shop/ShoppingCart/index", |
||||
"iconPath": "static/icon-cart.png", |
||||
"selectedIconPath": "static/icon-cart-hot.png", |
||||
"text": "购物车" |
||||
}, { |
||||
"pagePath": "pages/user/User/index", |
||||
"iconPath": "static/icon-user.png", |
||||
"selectedIconPath": "static/icon-user-hot.png", |
||||
"text": "我的" |
||||
}] |
||||
} |
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
||||
{ |
||||
"path": "pages/Loading/index", |
||||
"style": { |
||||
"navigationBarTitleText": "yshop商城" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/authorization/index", |
||||
"style": { |
||||
"navigationBarTitleText": "微信授权" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/Login/index", |
||||
"style": { |
||||
"navigationBarTitleText": "登录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/Register/index", |
||||
"style": { |
||||
"navigationBarTitleText": "注册" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/RetrievePassword/index", |
||||
"style": { |
||||
"navigationBarTitleText": "重置密码" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/launch/index", |
||||
"style": { |
||||
"navigationBarTitleText": "首页" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/home/index", |
||||
"style": { |
||||
"navigationBarTitleText": "yshop商城", |
||||
"navigationBarTextStyle": "white", |
||||
// "enablePullDownRefresh": true, |
||||
"navigationStyle": "custom" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodSearch/index", |
||||
"style": { |
||||
"navigationBarTitleText": "搜索商品" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsClass/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品分类" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/ShoppingCart/index", |
||||
"style": { |
||||
"navigationBarTitleText": "购物车" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/StoreList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/NotDefined/index", |
||||
"style": { |
||||
"navigationBarTitleText": "404" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/User/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsCollection/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品收藏" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsFoot/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的足迹" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/news/NewsDetail/index", |
||||
"style": { |
||||
"navigationBarTitleText": "新闻详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/news/NewsList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "新闻列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/EvaluateList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "评价列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsEvaluate/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品评价" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsPromotion/index", |
||||
"style": { |
||||
"navigationBarTitleText": "促销商品" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/HotNewGoods/index", |
||||
"style": { |
||||
"navigationBarTitleText": "热门商品" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/GoodsCon/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/IntegralGoodsCon/index", |
||||
"style": { |
||||
"navigationBarTitleText": "积分商品详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/BindingPhone/index", |
||||
"style": { |
||||
"navigationBarTitleText": "绑定手机号" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/address/AddAddress/index", |
||||
"style": { |
||||
"navigationBarTitleText": "新增收货地址" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/UserAccount/index", |
||||
"style": { |
||||
"navigationBarTitleText": "账户余额" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/address/AddressManagement/index", |
||||
"style": { |
||||
"navigationBarTitleText": "收货地址" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/Poster/index", |
||||
"style": { |
||||
"navigationBarTitleText": "推广名片" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/signIn/Sign/index", |
||||
"style": { |
||||
"navigationBarTitleText": "签到" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/signIn/SignRecord/index", |
||||
"style": { |
||||
"navigationBarTitleText": "签到记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/CashAudit/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提现结果" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/PromoterOrder/index", |
||||
"style": { |
||||
"navigationBarTitleText": "分销详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/PromoterList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "分销列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/UserPromotion/index", |
||||
"style": { |
||||
"navigationBarTitleText": "佣金" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/UserBill/index", |
||||
"style": { |
||||
"navigationBarTitleText": "账单记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/CashRecord/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提现记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/CommissionDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "佣金明细" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/signIn/Integral/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的积分" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/UserVip/index", |
||||
"style": { |
||||
"navigationBarTitleText": "用户vip" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/PersonalData/index", |
||||
"style": { |
||||
"navigationBarTitleText": "个人资料" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/coupon/UserCoupon/index", |
||||
"style": { |
||||
"navigationBarTitleText": "优惠券" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/coupon/GetCoupon/index", |
||||
"style": { |
||||
"navigationBarTitleText": "领取优惠券" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/promotion/UserCash/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提现" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/CustomerList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "客服列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/user/Recharge/index", |
||||
"style": { |
||||
"navigationBarTitleText": "充值" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/MyOrder/index", |
||||
"style": { |
||||
"navigationBarTitleText": "我的订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/Logistics/index", |
||||
"style": { |
||||
"navigationBarTitleText": "查看物流" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/OrderDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "订单详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/OrderSubmission/index", |
||||
"style": { |
||||
"navigationBarTitleText": "提交订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/PaymentStatus/index", |
||||
"style": { |
||||
"navigationBarTitleText": "支付状态" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/GoodsReturn/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商品退货" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/order/ReturnList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "退货列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/OrderIndex/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家订单统计" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/AdminOrderList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/GoodsDeliver/index", |
||||
"style": { |
||||
"navigationBarTitleText": "发货" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/AdminOrder/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家订单列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/Statistics/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家统计数据" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/orderAdmin/OrderCancellation/index", |
||||
"style": { |
||||
"navigationBarTitleText": "商家核销订单" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/Poster/index", |
||||
"style": { |
||||
"navigationBarTitleText": "推广海报" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/DargainDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "帮砍价" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GoodsBargain/index", |
||||
"style": { |
||||
"navigationBarTitleText": "砍价列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/BargainRecord/index", |
||||
"style": { |
||||
"navigationBarTitleText": "砍价记录" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GoodsGroup/index", |
||||
"style": { |
||||
"navigationBarTitleText": "团购商品列表" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GroupDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "团购商品详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GroupRule/index", |
||||
"style": { |
||||
"navigationBarTitleText": "团购规则" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/GoodsSeckill/index", |
||||
"style": { |
||||
"navigationBarTitleText": "秒杀" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/activity/SeckillDetails/index", |
||||
"style": { |
||||
"navigationBarTitleText": "秒杀详情" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/map/index", |
||||
"style": { |
||||
"navigationBarTitleText": "地图" |
||||
} |
||||
}, |
||||
{ |
||||
"path": "pages/shop/Live/LiveList/index", |
||||
"style": { |
||||
"navigationBarTitleText": "直播列表" |
||||
} |
||||
} |
||||
], |
||||
"globalStyle": { |
||||
"navigationBarTextStyle": "black", |
||||
"navigationBarTitleText": "Yshop", |
||||
"navigationBarBackgroundColor": "#F8F8F8", |
||||
"backgroundColor": "#F8F8F8", |
||||
"navigationStyle": "default" |
||||
}, |
||||
"tabBar": { |
||||
"color": "#282828", |
||||
"selectedColor": "#eb3729", |
||||
"borderStyle": "black", |
||||
"backgroundColor": "#ffffff", |
||||
"height": "50px", |
||||
"fontSize": "10px", |
||||
"iconWidth": "24px", |
||||
"spacing": "3px", |
||||
"list": [ |
||||
{ |
||||
"pagePath": "pages/home/index", |
||||
"iconPath": "static/icon-home.png", |
||||
"selectedIconPath": "static/icon-home-hot.png", |
||||
"text": "首页" |
||||
}, |
||||
{ |
||||
"pagePath": "pages/shop/GoodsClass/index", |
||||
"iconPath": "static/icon-class.png", |
||||
"selectedIconPath": "static/icon-class-hot.png", |
||||
"text": "分类" |
||||
}, |
||||
{ |
||||
"pagePath": "pages/shop/ShoppingCart/index", |
||||
"iconPath": "static/icon-cart.png", |
||||
"selectedIconPath": "static/icon-cart-hot.png", |
||||
"text": "购物车" |
||||
}, |
||||
{ |
||||
"pagePath": "pages/user/User/index", |
||||
"iconPath": "static/icon-user.png", |
||||
"selectedIconPath": "static/icon-user-hot.png", |
||||
"text": "我的" |
||||
} |
||||
] |
||||
} |
||||
} |
||||
|
@ -1,470 +1,447 @@
|
||||
<template> |
||||
<view class="index"> |
||||
<!-- 导航栏 --> |
||||
<!-- <view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">--> |
||||
<!-- <view class="cu-custom" :style="[{height:CustomBar+ 'px',}]">--> |
||||
<!-- <view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">--> |
||||
<!-- <view class="action">--> |
||||
<!-- <text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>--> |
||||
<!-- </view>--> |
||||
<!-- <view class="content" :style="[{top:StatusBar + 'px'}]">--> |
||||
|
||||
<!-- </view>--> |
||||
<!-- </view>--> |
||||
<!-- </view>--> |
||||
<!-- </view>--> |
||||
|
||||
<view |
||||
class="head_box" |
||||
:style="{ background: bgcolor }" |
||||
:class="{ active: bgcolor }" |
||||
> |
||||
<cu-custom :isBack="true" :bgColor="bgcolor"> |
||||
<block slot="backText"> |
||||
<text class="nav-title shopro-selector-rect">{{ "YSHOP商城" }}</text> |
||||
</block> |
||||
</cu-custom> |
||||
</view> |
||||
<view |
||||
class="header header-search acea-row row-center-wrapper" |
||||
:style="{ background: bgcolor }" |
||||
> |
||||
<view @click="goGoodSearch()" class="search acea-row row-middle"> |
||||
<text class="iconfont icon-xiazai5"></text> |
||||
搜索商品 |
||||
</view> |
||||
<view class="qr" @click="startQr()"> |
||||
<image src="@/static/images/qr.png" /> |
||||
</view> |
||||
</view> |
||||
<Banner |
||||
:detail="banner" |
||||
v-if="banner.length > 0" |
||||
@getbgcolor="getbgcolor" |
||||
></Banner> |
||||
<uni-notice-bar |
||||
scrollable="true" |
||||
@click="goRoll(singNew)" |
||||
single="true" |
||||
:speed="10" |
||||
showIcon="true" |
||||
:text="singNew.info" |
||||
></uni-notice-bar> |
||||
<view class="content_box home_content_box"> |
||||
<!-- 菜单 --> |
||||
<Menu :list="menus"></Menu> |
||||
<!-- 滚动新闻 --> |
||||
<!-- 广告 --> |
||||
<Adv /> |
||||
<!-- 热门榜单 --> |
||||
<HotCommodity :detail="likeInfo"></HotCommodity> |
||||
<!-- 超值拼团 --> |
||||
<Groupon :detail="combinationList" /> |
||||
<!-- 首发新品->秒杀 --> |
||||
<!-- <FirstNewProduct :detail="firstList"></FirstNewProduct> --> |
||||
<!-- 精品推荐 --> |
||||
<!-- <ProductsRecommended :detail="bastList"></ProductsRecommended> --> |
||||
<!-- 促销单品 |
||||
<PromoteProduct :detail="benefit"></PromoteProduct> --> |
||||
<!-- 直播 --> |
||||
<!-- #ifdef MP-WEIXIN --> |
||||
<Live :detail="live"></Live> |
||||
<!-- #endif --> |
||||
|
||||
<!-- 为您推荐 --> |
||||
<PromotionGood :benefit="benefit"></PromotionGood> |
||||
</view> |
||||
<Coupon-window |
||||
:coupon-list="couponList" |
||||
v-if="showCoupon" |
||||
@checked="couponClose" |
||||
@close="couponClose" |
||||
> |
||||
</Coupon-window> |
||||
</view> |
||||
<view class="index"> |
||||
<view v-for="(item,index) in homeData" :key="index"> |
||||
<view class="head_box" v-if="item.type=='header'" :style="{ background: bgcolor }" :class="{ active: bgcolor }"> |
||||
<cu-custom :isBack="true" :bgColor="bgcolor"> |
||||
<block slot="backText"> |
||||
<text class="nav-title shopro-selector-rect">{{ item.componentContent.title }}</text> |
||||
</block> |
||||
</cu-custom> |
||||
</view> |
||||
<view class="header header-search acea-row row-center-wrapper" v-if="item.type=='search'" :style="{ background: bgcolor }"> |
||||
<view @click="goGoodSearch()" class="search acea-row row-middle"> |
||||
<text class="iconfont icon-xiazai5"></text> |
||||
搜索商品 |
||||
</view> |
||||
<view class="qr" @click="startQr()"> |
||||
<image src="@/static/images/qr.png" /> |
||||
</view> |
||||
</view> |
||||
<Banner v-if="item.type=='banner'" :detail="item.componentContent.bannerData" @getbgcolor="getbgcolor"></Banner> |
||||
<uni-notice-bar v-if="item.type=='noticeBar'" scrollable="true" @click="goRoll(item.componentContent.roll[0])" single="true" :speed="10" |
||||
showIcon="true" :text="item.componentContent.roll[0].info"></uni-notice-bar> |
||||
<view class="content_box home_content_box"> |
||||
<!-- 菜单 --> |
||||
<Menu :list="item.componentContent.menus" v-if="item.type=='menu'"></Menu> |
||||
<!-- 滚动新闻 --> |
||||
<!-- 广告 --> |
||||
<Adv v-if="item.type=='adv'" :detail="item.componentContent.detail" /> |
||||
<!-- 热门榜单 --> |
||||
<HotCommodity v-if="item.type=='hotCommodity'" :detail="likeInfo"></HotCommodity> |
||||
<!-- 超值拼团 --> |
||||
<Groupon v-if="item.type=='groupon'" :detail="combinationList" /> |
||||
<!-- 首发新品->秒杀 --> |
||||
<FirstNewProduct v-if="item.type=='firstNewProduct'" :detail="firstList"></FirstNewProduct> |
||||
<!-- 精品推荐 --> |
||||
<ProductsRecommended v-if="item.type=='productsRecommended'" :detail="bastList"></ProductsRecommended> |
||||
<!-- 促销单品 --> |
||||
<PromoteProduct v-if="item.type=='promoteProduct'" :detail="benefit"></PromoteProduct> |
||||
<!-- 直播 --> |
||||
<!-- #ifdef MP-WEIXIN --> |
||||
<Live v-if="item.type=='live'" :detail="live"></Live> |
||||
<!-- #endif --> |
||||
<!-- 为您推荐 --> |
||||
<PromotionGood v-if="item.type=='promotionGood'" :benefit="benefit"></PromotionGood> |
||||
</view> |
||||
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"> |
||||
</Coupon-window> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
<script> |
||||
import { mapState, mapMutations, mapActions } from "vuex"; |
||||
import GoodList from "@/components/GoodList"; |
||||
import PromotionGood from "@/components/PromotionGood"; |
||||
import CouponWindow from "@/components/CouponWindow"; |
||||
import Menu from "@/components/Menu"; |
||||
import UniNoticeBar from "@/components/uni-notice-bar/uni-notice-bar"; |
||||
import Adv from "@/components/sh-adv"; |
||||
import Groupon from "@/components/sh-groupon.vue"; |
||||
import { |
||||
mapState, |
||||
mapMutations, |
||||
mapActions |
||||
} from "vuex"; |
||||
import GoodList from "@/components/GoodList"; |
||||
import PromotionGood from "@/components/PromotionGood"; |
||||
import CouponWindow from "@/components/CouponWindow"; |
||||
import Menu from "@/components/Menu"; |
||||
import UniNoticeBar from "@/components/uni-notice-bar/uni-notice-bar"; |
||||
import Adv from "@/components/sh-adv"; |
||||
import Groupon from "@/components/sh-groupon.vue"; |
||||
|
||||
import Banner from "./components/Banner"; |
||||
import HotCommodity from "./components/HotCommodity"; |
||||
import FirstNewProduct from "./components/FirstNewProduct"; |
||||
import ProductsRecommended from "./components/ProductsRecommended"; |
||||
import Live from "./components/Live"; |
||||
import Banner from "./components/Banner"; |
||||
import HotCommodity from "./components/HotCommodity"; |
||||
import FirstNewProduct from "./components/FirstNewProduct"; |
||||
import ProductsRecommended from "./components/ProductsRecommended"; |
||||
import Live from "./components/Live"; |
||||
|
||||
import { getHomeData, getShare } from "@/api/public"; |
||||
import cookie from "@/utils/store/cookie"; |
||||
import { isWeixin, handleUrlParam } from "@/utils/index"; |
||||
import { |
||||
getHomeData, |
||||
getShare, |
||||
getCanvas |
||||
} from "@/api/public"; |
||||
import cookie from "@/utils/store/cookie"; |
||||
import { |
||||
isWeixin, |
||||
handleUrlParam |
||||
} from "@/utils/index"; |
||||
|
||||
import { |
||||
openShareAll, |
||||
} from '@/libs/wechat' |
||||
import { |
||||
openShareAll, |
||||
} from '@/libs/wechat' |
||||
|
||||
const HAS_COUPON_WINDOW = "has_coupon_window"; |
||||
const HAS_COUPON_WINDOW = "has_coupon_window"; |
||||
|
||||
export default { |
||||
name: "Index", |
||||
components: { |
||||
// swiper, |
||||
// swiperSlide, |
||||
UniNoticeBar, |
||||
GoodList, |
||||
PromotionGood, |
||||
CouponWindow, |
||||
Menu, |
||||
Adv, |
||||
Groupon, |
||||
Banner, |
||||
HotCommodity, |
||||
FirstNewProduct, |
||||
ProductsRecommended, |
||||
Live, |
||||
}, |
||||
props: {}, |
||||
data: function () { |
||||
return { |
||||
CustomBar: this.CustomBar, |
||||
StatusBar: this.StatusBar, |
||||
formatMenus: [], |
||||
categoryCurrent: 0, |
||||
menuNum: 4, |
||||
bgcolor: "", |
||||
bgColor: "", |
||||
swiperCurrent: 0, //轮播下标 |
||||
webviewId: 0, |
||||
showCoupon: false, |
||||
logoUrl: "", |
||||
banner: [], |
||||
menus: [], |
||||
combinationList: [], |
||||
roll: [], |
||||
activity: [], |
||||
activityOne: {}, |
||||
bastList: [], |
||||
firstList: [], |
||||
info: { |
||||
fastList: [], |
||||
bastBanner: [], |
||||
export default { |
||||
name: "Index", |
||||
components: { |
||||
// swiper, |
||||
// swiperSlide, |
||||
UniNoticeBar, |
||||
GoodList, |
||||
PromotionGood, |
||||
CouponWindow, |
||||
Menu, |
||||
Adv, |
||||
Groupon, |
||||
Banner, |
||||
HotCommodity, |
||||
FirstNewProduct, |
||||
ProductsRecommended, |
||||
Live, |
||||
}, |
||||
props: {}, |
||||
data: function() { |
||||
return { |
||||
homeData: [], |
||||
CustomBar: this.CustomBar, |
||||
StatusBar: this.StatusBar, |
||||
formatMenus: [], |
||||
categoryCurrent: 0, |
||||
menuNum: 4, |
||||
bgcolor: "", |
||||
bgColor: "", |
||||
swiperCurrent: 0, //轮播下标 |
||||
webviewId: 0, |
||||
showCoupon: false, |
||||
logoUrl: "", |
||||
banner: [], |
||||
menus: [], |
||||
combinationList: [], |
||||
roll: [], |
||||
activity: [], |
||||
activityOne: {}, |
||||
bastList: [], |
||||
firstList: [], |
||||
info: { |
||||
fastList: [], |
||||
bastBanner: [], |
||||
|
||||
bastList: [], |
||||
}, |
||||
likeInfo: [], |
||||
live: [], |
||||
lovely: [], |
||||
benefit: [], |
||||
couponList: [], |
||||
swiperOption: { |
||||
pagination: { |
||||
el: ".swiper-pagination", |
||||
clickable: true, |
||||
}, |
||||
autoplay: { |
||||
disableOnInteraction: false, |
||||
delay: 2000, |
||||
}, |
||||
loop: true, |
||||
speed: 1000, |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperRoll: { |
||||
direction: "vertical", |
||||
autoplay: { |
||||
disableOnInteraction: false, |
||||
delay: 2000, |
||||
}, |
||||
loop: true, |
||||
speed: 1000, |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperScroll: { |
||||
freeMode: true, |
||||
freeModeMomentum: false, |
||||
slidesPerView: "auto", |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperBoutique: { |
||||
pagination: { |
||||
el: ".swiper-pagination", |
||||
clickable: true, |
||||
}, |
||||
autoplay: { |
||||
disableOnInteraction: false, |
||||
delay: 2000, |
||||
}, |
||||
loop: true, |
||||
speed: 1000, |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperProducts: { |
||||
freeMode: true, |
||||
freeModeMomentum: false, |
||||
slidesPerView: "auto", |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
bgImage: "", |
||||
}; |
||||
}, |
||||
computed: { |
||||
singNew() { |
||||
return this.roll.length > 0 ? this.roll[0] : "你还没添加通知哦!"; |
||||
}, |
||||
customStyle() { |
||||
var bgImage = this.bgImage; |
||||
// var style = `height:${this.CustomBar}px;padding-top:${0}px;background: ${this.bgcolor}`; |
||||
var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;background: ${this.bgcolor}`; |
||||
if (this.bgImage) { |
||||
style = `${style}background-image:url(${bgImage});`; |
||||
} |
||||
return style; |
||||
}, |
||||
}, |
||||
onLoad: function () { |
||||
this.getLocation(); |
||||
let that = this; |
||||
uni.showLoading({ |
||||
title: "加载中", |
||||
}); |
||||
getHomeData().then((res) => { |
||||
that.logoUrl = res.data.logoUrl; |
||||
res.data.banner.map((item) => (item.bgcolor = item.color || "")); |
||||
that.$set(that, "banner", res.data.banner); |
||||
that.$set(that, "menus", res.data.menus); |
||||
that.$set(that, "roll", res.data.roll); |
||||
that.$set(that, "info", res.data.info); |
||||
that.$set(that, "firstList", res.data.firstList); |
||||
that.$set(that, "bastList", res.data.bastList); |
||||
that.$set(that, "likeInfo", res.data.likeInfo); |
||||
that.$set(that, "live", res.data.liveList); |
||||
that.$set(that, "lovely", res.data.lovely); |
||||
that.$set(that, "benefit", res.data.benefit); |
||||
that.$set(that, "couponList", res.data.couponList); |
||||
that.$set(that, "combinationList", res.data.combinationList); |
||||
uni.hideLoading(); |
||||
that.setOpenShare(); |
||||
// that.doColorThief() |
||||
}); |
||||
}, |
||||
methods: { |
||||
...mapActions(["getLocation"]), |
||||
onShareTimeline: function () { |
||||
return { |
||||
title: this.miniHomeRemark, |
||||
imageUrl: this.miniHomeImg, |
||||
path: "pages/home/index?spread=" + uni.getStorageSync("uid"), |
||||
}; |
||||
}, |
||||
onShareAppMessage: function () { |
||||
return { |
||||
title: this.miniHomeRemark, |
||||
imageUrl: this.miniHomeImg, |
||||
path: "pages/home/index?spread=" + uni.getStorageSync("uid"), |
||||
}; |
||||
}, |
||||
goRoll(item) { |
||||
if (item.uniapp_url) { |
||||
this.$yrouter.push(item.uniapp_url); |
||||
} |
||||
}, |
||||
goGoodSearch() { |
||||
// this.$yrouter.push('/pages/shop/GoodsEvaluate/index'); |
||||
this.$yrouter.push("/pages/shop/GoodSearch/index"); |
||||
}, |
||||
goWxappUrl(item) { |
||||
this.$yrouter.push(item.uniapp_url); |
||||
}, |
||||
goHotNewGoods(type) { |
||||
this.$yrouter.push({ |
||||
path: "/pages/shop/HotNewGoods/index", |
||||
query: { |
||||
type, |
||||
}, |
||||
}); |
||||
}, |
||||
goGoodsCon(item) { |
||||
this.$yrouter.push({ |
||||
path: "/pages/shop/GoodsCon/index", |
||||
query: { |
||||
id: item.id, |
||||
}, |
||||
}); |
||||
}, |
||||
goGoodsPromotion() { |
||||
this.$yrouter.push("/pages/shop/GoodsPromotion/index"); |
||||
}, |
||||
setOpenShare: function () { |
||||
if (this.$deviceType == "weixin") { |
||||
getShare().then((res) => { |
||||
var data = res.data.data; |
||||
var configAppMessage = { |
||||
desc: data.synopsis, |
||||
title: data.title, |
||||
link: location.href, |
||||
imgUrl: data.img, |
||||
}; |
||||
openShareAll(configAppMessage); |
||||
}); |
||||
} |
||||
}, |
||||
startQr: function () { |
||||
uni.scanCode({ |
||||
success: (res) => { |
||||
let option = handleUrlParam(res.result); |
||||
switch (option.pageType) { |
||||
case "good": |
||||
// 跳转商品详情 |
||||
this.$yrouter.push({ |
||||
path: "/pages/shop/GoodsCon/index", |
||||
query: { |
||||
q: res.result, |
||||
}, |
||||
}); |
||||
break; |
||||
case "group": |
||||
// 跳转团购 |
||||
this.$yrouter.push({ |
||||
path: "/pages/activity/GroupRule/index", |
||||
query: { |
||||
q: res.result, |
||||
}, |
||||
}); |
||||
break; |
||||
case "dargain": |
||||
// 跳转砍价 |
||||
this.$yrouter.push({ |
||||
path: "/pages/activity/DargainDetails/index", |
||||
query: { |
||||
q: res.result, |
||||
}, |
||||
}); |
||||
break; |
||||
default: |
||||
// 跳转分销 |
||||
this.$yrouter.push({ |
||||
path: "/pages/Loading/index", |
||||
query: {}, |
||||
}); |
||||
break; |
||||
} |
||||
}, |
||||
}); |
||||
}, |
||||
getbgcolor(e) { |
||||
this.bgcolor = e; |
||||
}, |
||||
}, |
||||
created: async function () { |
||||
// await this.doColorThief(); |
||||
}, |
||||
}; |
||||
bastList: [], |
||||
}, |
||||
likeInfo: [], |
||||
live: [], |
||||
lovely: [], |
||||
benefit: [], |
||||
couponList: [], |
||||
swiperOption: { |
||||
pagination: { |
||||
el: ".swiper-pagination", |
||||
clickable: true, |
||||
}, |
||||
autoplay: { |
||||
disableOnInteraction: false, |
||||
delay: 2000, |
||||
}, |
||||
loop: true, |
||||
speed: 1000, |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperRoll: { |
||||
direction: "vertical", |
||||
autoplay: { |
||||
disableOnInteraction: false, |
||||
delay: 2000, |
||||
}, |
||||
loop: true, |
||||
speed: 1000, |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperScroll: { |
||||
freeMode: true, |
||||
freeModeMomentum: false, |
||||
slidesPerView: "auto", |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperBoutique: { |
||||
pagination: { |
||||
el: ".swiper-pagination", |
||||
clickable: true, |
||||
}, |
||||
autoplay: { |
||||
disableOnInteraction: false, |
||||
delay: 2000, |
||||
}, |
||||
loop: true, |
||||
speed: 1000, |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
swiperProducts: { |
||||
freeMode: true, |
||||
freeModeMomentum: false, |
||||
slidesPerView: "auto", |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
bgImage: "", |
||||
}; |
||||
}, |
||||
computed: { |
||||
singNew() { |
||||
return this.roll.length > 0 ? this.roll[0] : "你还没添加通知哦!"; |
||||
}, |
||||
customStyle() { |
||||
var bgImage = this.bgImage; |
||||
// var style = `height:${this.CustomBar}px;padding-top:${0}px;background: ${this.bgcolor}`; |
||||
var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;background: ${this.bgcolor}`; |
||||
if (this.bgImage) { |
||||
style = `${style}background-image:url(${bgImage});`; |
||||
} |
||||
return style; |
||||
}, |
||||
}, |
||||
onLoad: function() { |
||||
this.getLocation(); |
||||
let that = this; |
||||
// uni.showLoading({ |
||||
// title: "加载中", |
||||
// }); |
||||
getCanvas().then(res => { |
||||
}).catch(error => { |
||||
this.homeData = JSON.parse(error.data.json) |
||||
}) |
||||
getHomeData().then((res) => { |
||||
that.logoUrl = res.data.logoUrl; |
||||
res.data.banner.map((item) => (item.bgcolor = item.color || "")); |
||||
that.$set(that, "info", res.data.info); |
||||
that.$set(that, "firstList", res.data.firstList); |
||||
that.$set(that, "bastList", res.data.bastList); |
||||
that.$set(that, "likeInfo", res.data.likeInfo); |
||||
that.$set(that, "live", res.data.liveList); |
||||
that.$set(that, "lovely", res.data.lovely); |
||||
that.$set(that, "benefit", res.data.benefit); |
||||
that.$set(that, "couponList", res.data.couponList); |
||||
that.$set(that, "combinationList", res.data.combinationList); |
||||
uni.hideLoading(); |
||||
that.setOpenShare(); |
||||
// that.doColorThief() |
||||
}); |
||||
}, |
||||
methods: { |
||||
...mapActions(["getLocation"]), |
||||
onShareTimeline: function() { |
||||
return { |
||||
title: this.miniHomeRemark, |
||||
imageUrl: this.miniHomeImg, |
||||
path: "pages/home/index?spread=" + uni.getStorageSync("uid"), |
||||
}; |
||||
}, |
||||
onShareAppMessage: function() { |
||||
return { |
||||
title: this.miniHomeRemark, |
||||
imageUrl: this.miniHomeImg, |
||||
path: "pages/home/index?spread=" + uni.getStorageSync("uid"), |
||||
}; |
||||
}, |
||||
goRoll(item) { |
||||
if (item.uniapp_url) { |
||||
this.$yrouter.push(item.uniapp_url); |
||||
} |
||||
}, |
||||
goGoodSearch() { |
||||
// this.$yrouter.push('/pages/shop/GoodsEvaluate/index'); |
||||
this.$yrouter.push("/pages/shop/GoodSearch/index"); |
||||
}, |
||||
goWxappUrl(item) { |
||||
this.$yrouter.push(item.uniapp_url); |
||||
}, |
||||
goHotNewGoods(type) { |
||||
this.$yrouter.push({ |
||||
path: "/pages/shop/HotNewGoods/index", |
||||
query: { |
||||
type, |
||||
}, |
||||
}); |
||||
}, |
||||
goGoodsCon(item) { |
||||
this.$yrouter.push({ |
||||
path: "/pages/shop/GoodsCon/index", |
||||
query: { |
||||
id: item.id, |
||||
}, |
||||
}); |
||||
}, |
||||
goGoodsPromotion() { |
||||
this.$yrouter.push("/pages/shop/GoodsPromotion/index"); |
||||
}, |
||||
setOpenShare: function() { |
||||
if (this.$deviceType == "weixin") { |
||||
getShare().then((res) => { |
||||
var data = res.data.data; |
||||
var configAppMessage = { |
||||
desc: data.synopsis, |
||||
title: data.title, |
||||
link: location.href, |
||||
imgUrl: data.img, |
||||
}; |
||||
openShareAll(configAppMessage); |
||||
}); |
||||
} |
||||
}, |
||||
startQr: function() { |
||||
uni.scanCode({ |
||||
success: (res) => { |
||||
let option = handleUrlParam(res.result); |
||||
switch (option.pageType) { |
||||
case "good": |
||||
// 跳转商品详情 |
||||
this.$yrouter.push({ |
||||
path: "/pages/shop/GoodsCon/index", |
||||
query: { |
||||
q: res.result, |
||||
}, |
||||
}); |
||||
break; |
||||
case "group": |
||||
// 跳转团购 |
||||
this.$yrouter.push({ |
||||
path: "/pages/activity/GroupRule/index", |
||||
query: { |
||||
q: res.result, |
||||
}, |
||||
}); |
||||
break; |
||||
case "dargain": |
||||
// 跳转砍价 |
||||
this.$yrouter.push({ |
||||
path: "/pages/activity/DargainDetails/index", |
||||
query: { |
||||
q: res.result, |
||||
}, |
||||
}); |
||||
break; |
||||
default: |
||||
// 跳转分销 |
||||
this.$yrouter.push({ |
||||
path: "/pages/Loading/index", |
||||
query: {}, |
||||
}); |
||||
break; |
||||
} |
||||
}, |
||||
}); |
||||
}, |
||||
getbgcolor(e) { |
||||
this.bgcolor = e; |
||||
}, |
||||
}, |
||||
created: async function() { |
||||
// await this.doColorThief(); |
||||
}, |
||||
}; |
||||
</script> |
||||
<style scoped lang="less"> |
||||
.content_box { |
||||
background: #f6f6f6; |
||||
} |
||||
.content_box { |
||||
background: #f6f6f6; |
||||
} |
||||
|
||||
.index { |
||||
background-color: #fff; |
||||
} |
||||
.index { |
||||
background-color: #fff; |
||||
} |
||||
|
||||
.swiper-item { |
||||
height: 100%; |
||||
} |
||||
.swiper-item { |
||||
height: 100%; |
||||
} |
||||
|
||||
.fixed-header { |
||||
position: fixed; |
||||
z-index: 99; |
||||
// #ifdef H5 |
||||
top: 88rpx; |
||||
// #endif |
||||
.fixed-header { |
||||
position: fixed; |
||||
z-index: 99; |
||||
// #ifdef H5 |
||||
top: 88rpx; |
||||
// #endif |
||||
|
||||
// #ifndef H5 |
||||
top: 0; |
||||
// #endif |
||||
left: 0; |
||||
right: 0; |
||||
background: #fff; |
||||
box-shadow: 0 0 20rpx -10rpx #aaa; |
||||
// #ifndef H5 |
||||
top: 0; |
||||
// #endif |
||||
left: 0; |
||||
right: 0; |
||||
background: #fff; |
||||
box-shadow: 0 0 20rpx -10rpx #aaa; |
||||
|
||||
& + .fixed-header-box { |
||||
height: 98rpx; |
||||
} |
||||
} |
||||
&+.fixed-header-box { |
||||
height: 98rpx; |
||||
} |
||||
} |
||||
|
||||
.head_box { |
||||
width: 750rpx; |
||||
// background: #fff; |
||||
transition: all linear 0.3s; |
||||
.head_box { |
||||
width: 750rpx; |
||||
// background: #fff; |
||||
transition: all linear 0.3s; |
||||
|
||||
/deep/.cuIcon-back { |
||||
display: none; |
||||
} |
||||
/deep/.cuIcon-back { |
||||
display: none; |
||||
} |
||||
|
||||
.nav-title { |
||||
font-size: 38rpx; |
||||
font-family: PingFang SC; |
||||
font-weight: 500; |
||||
color: #fff; |
||||
} |
||||
} |
||||
.nav-title { |
||||
font-size: 38rpx; |
||||
font-family: PingFang SC; |
||||
font-weight: 500; |
||||
color: #fff; |
||||
} |
||||
} |
||||
|
||||
.cu-bar.fixed { |
||||
position: fixed; |
||||
width: 100%; |
||||
top: 0; |
||||
z-index: 1024; |
||||
// box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1); |
||||
} |
||||
.cu-bar.fixed { |
||||
position: fixed; |
||||
width: 100%; |
||||
top: 0; |
||||
z-index: 1024; |
||||
// box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1); |
||||
} |
||||
|
||||
.cu-bar { |
||||
box-sizing: border-box; |
||||
.cu-bar { |
||||
box-sizing: border-box; |
||||
|
||||
.index .header { |
||||
height: 64rpx; |
||||
// width: 100%; |
||||
// padding: 0 30rpx; |
||||
// box-sizing: border-box; |
||||
} |
||||
} |
||||
.index .header { |
||||
height: 64rpx; |
||||
// width: 100%; |
||||
// padding: 0 30rpx; |
||||
// box-sizing: border-box; |
||||
} |
||||
} |
||||
|
||||
.header-search { |
||||
transition: all linear 0.3s; |
||||
} |
||||
.header-search { |
||||
transition: all linear 0.3s; |
||||
} |
||||
|
||||
.cu-bar .action { |
||||
display: -webkit-box; |
||||
display: -webkit-flex; |
||||
display: flex; |
||||
align-items: center; |
||||
height: 100%; |
||||
max-height: 100%; |
||||
.cu-bar .action { |
||||
display: -webkit-box; |
||||
display: -webkit-flex; |
||||
display: flex; |
||||
align-items: center; |
||||
height: 100%; |
||||
max-height: 100%; |
||||
|
||||
&:first-child { |
||||
margin-left: 15px; |
||||
font-size: 15px; |
||||
} |
||||
} |
||||
&:first-child { |
||||
margin-left: 15px; |
||||
font-size: 15px; |
||||
} |
||||
} |
||||
|
||||
.home_content_box { |
||||
margin-top: -10rpx; |
||||
} |
||||
.home_content_box { |
||||
margin-top: -10rpx; |
||||
} |
||||
|
||||
.head_box { |
||||
} |
||||
.head_box {} |
||||
|
||||
.nav-title { |
||||
margin-left: 20rpx; |
||||
line-height: 40px; |
||||
} |
||||
</style> |
||||
.nav-title { |
||||
margin-left: 20rpx; |
||||
line-height: 40px; |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,867 @@
|
||||
<template> |
||||
<view :class="productConClass"> |
||||
<view v-if="storeInfo.id"> |
||||
<!-- 轮播图 --> |
||||
<product-con-swiper :img-urls="storeInfo.sliderImageArr"></product-con-swiper> |
||||
|
||||
<!-- 商品信息描述 --> |
||||
<view class="wrapper"> |
||||
<view class="share acea-row row-between row-bottom"> |
||||
<view class="money font-color-red"> |
||||
<text class="num">{{ attr.productSelect.integral || storeInfo.integral }}积分</text> |
||||
</view> |
||||
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view> |
||||
</view> |
||||
<view class="introduce">{{ storeInfo.storeName }}</view> |
||||
<view class="label acea-row row-between-wrapper"> |
||||
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text> |
||||
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text> |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- 规格 --> |
||||
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap"> |
||||
<view> |
||||
<text>{{ attrTxt }}:</text> |
||||
<text class="atterTxt">{{ attrValue }}</text> |
||||
</view> |
||||
<view class="iconfont icon-jiantou"></view> |
||||
</view> |
||||
|
||||
<!-- 用户评价 --> |
||||
<view class="userEvaluation" v-if="replyCount"> |
||||
<view class="title acea-row row-between-wrapper"> |
||||
<view>用户评价({{ replyCount }})</view> |
||||
<text @click="goEvaluateList(id)" class="praise"> |
||||
<text class="font-color-red">{{ replyChance }}%</text>好评率 |
||||
<text class="iconfont icon-jiantou"></text> |
||||
</text> |
||||
</view> |
||||
<user-evaluation :reply="reply"></user-evaluation> |
||||
</view> |
||||
|
||||
<!-- 商品详情 --> |
||||
<view class="product-intro"> |
||||
<text class="title">产品介绍</text> |
||||
<view class="conter" v-html="storeInfo.description"></view> |
||||
</view> |
||||
|
||||
<view style="height: 100rpx"></view> |
||||
<!-- 操作栏 --> |
||||
<view class="footer acea-row row-between-wrapper"> |
||||
<view class="item" @click="goHome"> |
||||
<view class="iconfont icon-shouye-xianxing"></view> |
||||
<text>首页</text> |
||||
</view> |
||||
<view class="bnt in-bnt acea-row"> |
||||
<view class="buy" @click="tapBuy"> |
||||
<text>立即购买</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- 商品规格弹窗 --> |
||||
<ProductWindow :isIntegral="isIntegral" v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow> |
||||
<!-- 分享海报 --> |
||||
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus" :posterData="posterData" :goodId="id"></StorePoster> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper"; |
||||
|
||||
import ProductConSwiper from '@/components/ProductConSwiper' |
||||
import UserEvaluation from '@/components/UserEvaluation' |
||||
import CouponPop from '@/components/CouponPop' |
||||
import ProductWindow from '@/components/ProductWindow' |
||||
import StorePoster from '@/components/StorePoster' |
||||
import ShareInfo from '@/components/ShareInfo' |
||||
import { getProductDetail, postCartAdd, getCartCount, getProductCode } from '@/api/store' |
||||
import { getCoupon, getCollectAdd, getCollectDel, getUserInfo } from '@/api/user' |
||||
import cookie from '@/utils/store/cookie' |
||||
import { isWeixin, PosterCanvas, handleQrCode, handleUrlParam, getCurrentPageUrlWithArgs } from '@/utils' |
||||
import { wechatEvevt } from '@/libs/wechat' |
||||
import { imageBase64 } from '@/api/public' |
||||
import { mapGetters } from 'vuex' |
||||
|
||||
export default { |
||||
name: 'GoodsCon', |
||||
components: { |
||||
// swiper, |
||||
// swiperSlide, |
||||
ProductConSwiper, |
||||
UserEvaluation, |
||||
CouponPop, |
||||
ProductWindow, |
||||
StorePoster, |
||||
ShareInfo, |
||||
}, |
||||
data: function () { |
||||
return { |
||||
shareInfoStatus: false, |
||||
weixinStatus: false, |
||||
mapShow: false, |
||||
mapKey: '', |
||||
posterData: { |
||||
image: '', |
||||
title: '', |
||||
price: '', |
||||
code: '', |
||||
}, |
||||
posterImageStatus: false, |
||||
animated: false, |
||||
coupon: { |
||||
coupon: false, |
||||
list: [], |
||||
}, |
||||
attr: { |
||||
cartAttr: false, |
||||
productAttr: [], |
||||
productSelect: {}, |
||||
}, |
||||
isOpen: false, //是否打开属性组件 |
||||
productValue: [], |
||||
id: 0, |
||||
storeInfo: {}, |
||||
couponList: [], |
||||
attrTxt: '请选择', |
||||
attrValue: '', |
||||
cart_num: 1, //购买数量 |
||||
replyCount: '', |
||||
replyChance: '', |
||||
reply: [], |
||||
priceName: 0, |
||||
CartCount: 0, |
||||
posters: false, |
||||
banner: [{}, {}], |
||||
swiperRecommend: { |
||||
pagination: { |
||||
el: '.swiper-pagination', |
||||
clickable: true, |
||||
}, |
||||
autoplay: false, |
||||
loop: false, |
||||
speed: 1000, |
||||
observer: true, |
||||
observeParents: true, |
||||
}, |
||||
goodList: [], |
||||
systemStore: {}, |
||||
qqmapsdk: null, |
||||
productConClass: 'product-con', |
||||
tempName: '全国包邮', |
||||
isIntegral: false, |
||||
} |
||||
}, |
||||
computed: mapGetters(['isLogin', 'location']), |
||||
mounted: function () { |
||||
this.$store.commit('get_to', 'goodcon') |
||||
let url = handleQrCode() |
||||
if (!url) { |
||||
url = handleUrlParam(getCurrentPageUrlWithArgs()) |
||||
} |
||||
this.coupons() |
||||
if (url && url.id) { |
||||
this.id = url.id |
||||
let urlSpread = parseInt(url.spread) |
||||
if (urlSpread) { |
||||
cookie.set('spread', urlSpread) |
||||
} |
||||
} else { |
||||
this.id = this._route.query.id |
||||
} |
||||
this.isIntegral = url.isIntegral == 'true' |
||||
this.productCon() |
||||
this.setOpenShare() |
||||
}, |
||||
watch: { |
||||
posterImageStatus(status) { |
||||
console.log(status) |
||||
if (status) { |
||||
this.productConClass = 'noscroll product-con' |
||||
} else { |
||||
this.productConClass = 'product-con' |
||||
} |
||||
}, |
||||
}, |
||||
methods: { |
||||
onShareAppMessage: function () { |
||||
return { |
||||
title: this.storeInfo.storeName, |
||||
imageUrl: this.storeInfo.image, |
||||
path: 'pages/shop/GoodsCon/index?id=' + this.storeInfo.id + '&spread=' + uni.getStorageSync('uid') + '&pageType=good&codeType=routine', |
||||
success(res) { |
||||
uni.showToast({ |
||||
title: '分享成功', |
||||
}) |
||||
}, |
||||
fail(res) { |
||||
uni.showToast({ |
||||
title: '分享失败', |
||||
icon: 'none', |
||||
}) |
||||
}, |
||||
} |
||||
}, |
||||
goHome() { |
||||
this.$yrouter.switchTab('/pages/home/index') |
||||
}, |
||||
goShoppingCart() { |
||||
this.$yrouter.switchTab('/pages/shop/ShoppingCart/index') |
||||
}, |
||||
goCustomerList() { |
||||
this.$yrouter.push({ |
||||
path: '/pages/user/CustomerList/index', |
||||
}) |
||||
}, |
||||
goStoreList() { |
||||
this.$yrouter.push({ |
||||
path: '/pages/shop/StoreList/index', |
||||
}) |
||||
}, |
||||
goEvaluateList(id) { |
||||
this.$yrouter.push({ |
||||
path: '/pages/shop/EvaluateList/index', |
||||
query: { |
||||
id, |
||||
}, |
||||
}) |
||||
}, |
||||
telPhone(phoneNumber) { |
||||
uni.makePhoneCall({ |
||||
phoneNumber: phoneNumber, |
||||
fail() { |
||||
console.log('取消拨打') |
||||
}, |
||||
}) |
||||
}, |
||||
showChang: function (data) { |
||||
this.$yrouter.push({ |
||||
path: '/pages/map/index', |
||||
query: data, |
||||
}) |
||||
}, |
||||
updateTitle() { |
||||
// document.title = this.storeInfo.storeName || this.$yroute.meta.title; |
||||
}, |
||||
setShareInfoStatus: function () { |
||||
this.shareInfoStatus = !this.shareInfoStatus |
||||
this.posters = false |
||||
}, |
||||
shareCode: function () { |
||||
var that = this |
||||
getProductCode(that.id).then(res => { |
||||
that.posterData.code = res.data.code |
||||
that.listenerActionSheet() |
||||
}) |
||||
}, |
||||
setPosterImageStatus: function () { |
||||
this.posterImageStatus = !this.posterImageStatus |
||||
this.posters = false |
||||
}, |
||||
//产品详情接口; |
||||
productCon: function () { |
||||
let that = this |
||||
let from = this.location |
||||
if (this.$deviceType == 'app') { |
||||
from.from = 'app' |
||||
} |
||||
uni.showLoading({ |
||||
title: '加载中', |
||||
mask: true, |
||||
}) |
||||
getProductDetail(that.id, from) |
||||
.then(res => { |
||||
res.data.storeInfo.description = res.data.storeInfo.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"') |
||||
that.$set(that, 'storeInfo', res.data.storeInfo) |
||||
// 给 attr 赋值,将请求回来的规格赋值给 attr |
||||
that.$set(that.attr, 'productAttr', res.data.productAttr) |
||||
that.$set(that, 'productValue', res.data.productValue) |
||||
that.$set(that, 'replyCount', res.data.replyCount) |
||||
that.$set(that, 'replyChance', res.data.replyChance) |
||||
that.reply = res.data.reply ? [res.data.reply] : [] |
||||
that.$set(that, 'reply', that.reply) |
||||
that.$set(that, 'priceName', res.data.priceName) |
||||
that.$set(that, 'tempName', res.data.tempName) |
||||
that.posterData.image = that.storeInfo.image |
||||
if (that.storeInfo.storeName.length > 30) { |
||||
that.posterData.title = that.storeInfo.storeName.substring(0, 30) + '...' |
||||
} else { |
||||
that.posterData.title = that.storeInfo.storeName |
||||
} |
||||
that.posterData.price = that.storeInfo.price |
||||
that.posterData.code = that.storeInfo.codeBase |
||||
that.systemStore = res.data.systemStore |
||||
let good_list = res.data.goodList || [] |
||||
let goodArray = [] |
||||
let count = Math.ceil(good_list.length / 6) |
||||
for (let i = 0; i < count; i++) { |
||||
var list = good_list.slice(i * 6, 6) |
||||
if (list.length) |
||||
goodArray.push({ |
||||
list: list, |
||||
}) |
||||
} |
||||
that.mapKay = res.data.mapKay |
||||
that.$set(that, 'goodList', goodArray) |
||||
that.updateTitle() |
||||
that.DefaultSelect() |
||||
that.getCartCount() |
||||
}) |
||||
.catch(err => { |
||||
uni.showToast({ |
||||
title: err.msg || err.response.data.msg || err.response.data.message, |
||||
icon: 'none', |
||||
duration: 2000, |
||||
}) |
||||
}) |
||||
.finally(() => { |
||||
uni.hideLoading() |
||||
}) |
||||
}, |
||||
//默认选中属性; |
||||
DefaultSelect: function () { |
||||
let productAttr = this.attr.productAttr |
||||
let value = [] |
||||
for (let i = 0; i < productAttr.length; i++) { |
||||
this.$set(productAttr[i], 'index', 0) |
||||
value.push(productAttr[i].attrValueArr[0]) |
||||
} |
||||
//sort();排序函数:数字-英文-汉字; |
||||
let productSelect = this.productValue[value.sort().join(',')] |
||||
if (productSelect && productAttr.length) { |
||||
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName) |
||||
this.$set(this.attr.productSelect, 'image', productSelect.image) |
||||
this.$set(this.attr.productSelect, 'price', productSelect.price) |
||||
this.$set(this.attr.productSelect, 'stock', productSelect.stock) |
||||
this.$set(this.attr.productSelect, 'unique', productSelect.unique) |
||||
this.$set(this.attr.productSelect, 'integral', productSelect.integral) |
||||
this.$set(this.attr.productSelect, 'cart_num', 1) |
||||
this.$set(this, 'attrValue', value.sort().join(',')) |
||||
this.$set(this, 'attrTxt', '已选择') |
||||
} else if (!productSelect && productAttr.length) { |
||||
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName) |
||||
this.$set(this.attr.productSelect, 'image', this.storeInfo.image) |
||||
this.$set(this.attr.productSelect, 'price', this.storeInfo.price) |
||||
this.$set(this.attr.productSelect, 'integral', this.storeInfo.integral) |
||||
this.$set(this.attr.productSelect, 'stock', 0) |
||||
this.$set(this.attr.productSelect, 'unique', '') |
||||
this.$set(this.attr.productSelect, 'cart_num', 0) |
||||
this.$set(this, 'attrValue', '') |
||||
this.$set(this, 'attrTxt', '请选择') |
||||
} else if (!productSelect && !productAttr.length) { |
||||
this.$set(this.attr.productSelect, 'store_name', this.storeInfo.storeName) |
||||
this.$set(this.attr.productSelect, 'image', this.storeInfo.image) |
||||
this.$set(this.attr.productSelect, 'price', this.storeInfo.price) |
||||
this.$set(this.attr.productSelect, 'stock', this.storeInfo.stock) |
||||
this.$set(this.attr.productSelect, 'integral', this.storeInfo.integral) |
||||
this.$set(this.attr.productSelect, 'unique', this.storeInfo.unique || '') |
||||
this.$set(this.attr.productSelect, 'cart_num', 1) |
||||
this.$set(this, 'attrValue', '') |
||||
this.$set(this, 'attrTxt', '请选择') |
||||
} |
||||
}, |
||||
//购物车; |
||||
ChangeCartNum: function (changeValue) { |
||||
//changeValue:是否 加|减 |
||||
//获取当前变动属性 |
||||
let productSelect = this.productValue[this.attrValue] |
||||
//如果没有属性,赋值给商品默认库存 |
||||
if (productSelect === undefined && !this.attr.productAttr.length) { |
||||
productSelect = this.attr.productSelect |
||||
} |
||||
//无属性值即库存为0;不存在加减; |
||||
if (productSelect === undefined) return |
||||
let stock = productSelect.stock || 0 |
||||
let num = this.attr.productSelect |
||||
if (changeValue) { |
||||
num.cart_num++ |
||||
if (num.cart_num > stock) { |
||||
this.$set(this.attr.productSelect, 'cart_num', stock) |
||||
this.$set(this, 'cart_num', stock) |
||||
} else { |
||||
this.$set(this.attr.productSelect, 'cart_num', num.cart_num) |
||||
this.$set(this, 'cart_num', num.cart_num) |
||||
} |
||||
} else { |
||||
num.cart_num-- |
||||
if (num.cart_num < 1) { |
||||
this.$set(this.attr.productSelect, 'cart_num', 1) |
||||
this.$set(this, 'cart_num', 1) |
||||
} else { |
||||
this.$set(this.attr.productSelect, 'cart_num', num.cart_num) |
||||
this.$set(this, 'cart_num', num.cart_num) |
||||
} |
||||
} |
||||
}, |
||||
//将父级向子集多次传送的函数合二为一; |
||||
changeFun: function (opt) { |
||||
if (typeof opt !== 'object') opt = {} |
||||
let action = opt.action || '' |
||||
let value = opt.value === undefined ? '' : opt.value |
||||
this[action] && this[action](value) |
||||
}, |
||||
//打开优惠券插件; |
||||
couponTap: function () { |
||||
let that = this |
||||
that.coupons() |
||||
that.coupon.coupon = true |
||||
}, |
||||
changecoupon: function (msg) { |
||||
this.coupon.coupon = msg |
||||
this.coupons() |
||||
}, |
||||
currentcoupon: function (res) { |
||||
let that = this |
||||
that.coupon.coupon = false |
||||
that.$set(that.coupon.list[res], 'is_use', true) |
||||
}, |
||||
//可领取优惠券接口; |
||||
coupons: function () { |
||||
let that = this, |
||||
q = { |
||||
page: 1, |
||||
limit: 20, |
||||
} |
||||
getCoupon(q).then(res => { |
||||
that.$set(that, 'couponList', res.data || []) |
||||
that.$set(that.coupon, 'list', res.data) |
||||
}) |
||||
}, |
||||
//打开属性插件; |
||||
selecAttrTap: function () { |
||||
this.attr.cartAttr = true |
||||
this.isOpen = true |
||||
}, |
||||
changeattr: function (msg) { |
||||
// 修改了规格 |
||||
console.log(msg) |
||||
this.attr.cartAttr = msg |
||||
this.isOpen = false |
||||
}, |
||||
//选择属性; |
||||
ChangeAttr: function (res) { |
||||
// 修改了规格 |
||||
|
||||
let productSelect = this.productValue[res.value] |
||||
console.log(productSelect) |
||||
if (productSelect) { |
||||
this.attr.productAttr[res.indexw].index = res.indexn |
||||
this.$set(this.attr.productSelect, 'image', productSelect.image) |
||||
this.$set(this.attr.productSelect, 'price', productSelect.price) |
||||
this.$set(this.attr.productSelect, 'stock', productSelect.stock) |
||||
this.$set(this.attr.productSelect, 'unique', productSelect.unique) |
||||
this.$set(this.attr.productSelect, 'integral', productSelect.integral) |
||||
this.$set(this.attr.productSelect, 'cart_num', 1) |
||||
this.$set(this, 'attrValue', res.value) |
||||
this.$set(this, 'attrTxt', '已选择') |
||||
} else { |
||||
this.$set(this.attr.productSelect, 'image', this.storeInfo.image) |
||||
this.$set(this.attr.productSelect, 'price', this.storeInfo.price) |
||||
this.$set(this.attr.productSelect, 'integral', this.storeInfo.price) |
||||
this.$set(this.attr.productSelect, 'stock', 0) |
||||
this.$set(this.attr.productSelect, 'unique', '') |
||||
this.$set(this.attr.productSelect, 'cart_num', 0) |
||||
this.$set(this, 'attrValue', '') |
||||
this.$set(this, 'attrTxt', '请选择') |
||||
} |
||||
}, |
||||
//收藏商品 |
||||
setCollect: function () { |
||||
let that = this, |
||||
id = that.storeInfo.id, |
||||
category = 'collect' |
||||
if (that.storeInfo.userCollect) { |
||||
getCollectDel(id, category).then(function () { |
||||
that.storeInfo.userCollect = !that.storeInfo.userCollect |
||||
}) |
||||
} else { |
||||
getCollectAdd(id, category).then(function () { |
||||
that.storeInfo.userCollect = !that.storeInfo.userCollect |
||||
}) |
||||
} |
||||
}, |
||||
// 点击加入购物车按钮 |
||||
joinCart: function () { |
||||
//0=加入购物车 |
||||
this.goCat(0) |
||||
}, |
||||
// 加入购物车; |
||||
goCat: function (news) { |
||||
let that = this, |
||||
productSelect = that.productValue[this.attrValue] |
||||
//打开属性 |
||||
if (that.attrValue) { |
||||
//默认选中了属性,但是没有打开过属性弹窗还是自动打开让用户查看默认选中的属性 |
||||
that.attr.cartAttr = !that.isOpen ? true : false |
||||
} else { |
||||
if (that.isOpen) that.attr.cartAttr = true |
||||
else that.attr.cartAttr = !that.attr.cartAttr |
||||
} |
||||
//只有关闭属性弹窗时进行加入购物车 |
||||
if (that.attr.cartAttr === true && that.isOpen === false) return (that.isOpen = true) |
||||
//如果有属性,没有选择,提示用户选择 |
||||
if (that.attr.productAttr.length && productSelect === undefined && that.isOpen === true) { |
||||
uni.showToast({ |
||||
title: '产品库存不足,请选择其它', |
||||
icon: 'none', |
||||
duration: 2000, |
||||
}) |
||||
return |
||||
} |
||||
let q = { |
||||
productId: that.id, |
||||
cartNum: that.attr.productSelect.cart_num, |
||||
new: news, |
||||
uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : '', |
||||
} |
||||
postCartAdd(q) |
||||
.then(function (res) { |
||||
console.log(res) |
||||
that.isOpen = false |
||||
that.attr.cartAttr = false |
||||
if (news) { |
||||
if (!res.data) { |
||||
uni.showToast({ |
||||
title: res.msg || res.data.msg || res.data.message, |
||||
icon: 'none', |
||||
duration: 2000, |
||||
}) |
||||
return |
||||
} |
||||
that.$yrouter.push({ |
||||
path: '/pages/order/OrderSubmission/index', |
||||
query: { |
||||
id: res.data.cartId, |
||||
isIntegral: that.isIntegral, |
||||
}, |
||||
}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: '添加购物车成功', |
||||
icon: 'success', |
||||
duration: 2000, |
||||
complete: () => { |
||||
that.getCartCount(true) |
||||
}, |
||||
}) |
||||
} |
||||
}) |
||||
.catch(error => { |
||||
console.log(error) |
||||
that.isOpen = false |
||||
uni.showToast({ |
||||
title: error.msg || error.response.data.msg || error.response.data.message, |
||||
icon: 'none', |
||||
duration: 2000, |
||||
}) |
||||
}) |
||||
}, |
||||
//获取购物车数量 |
||||
getCartCount: function (isAnima) { |
||||
let that = this |
||||
const isLogin = that.isLogin |
||||
if (isLogin) { |
||||
getCartCount({ |
||||
numType: 0, |
||||
}).then(res => { |
||||
that.CartCount = res.data.count |
||||
//加入购物车后重置属性 |
||||
if (isAnima) { |
||||
that.animated = true |
||||
setTimeout(function () { |
||||
that.animated = false |
||||
}, 500) |
||||
} |
||||
}) |
||||
} |
||||
}, |
||||
//立即购买; |
||||
tapBuy: function () { |
||||
// 1=直接购买 |
||||
this.goCat(1) |
||||
}, |
||||
listenerActionSheet: function () { |
||||
if (isWeixin() === true) { |
||||
this.weixinStatus = true |
||||
} |
||||
this.posters = true |
||||
}, |
||||
listenerActionClose: function () { |
||||
this.posters = false |
||||
}, |
||||
setOpenShare: function () { |
||||
var data = this.storeInfo |
||||
var href = this.location.href |
||||
if (this.$deviceType == 'weixin') { |
||||
if (this.isLogin) { |
||||
getUserInfo().then(res => { |
||||
href = href.indexOf('?') === -1 ? href + '?spread=' + res.data.uid : href + '&spread=' + res.data.uid |
||||
var configAppMessage = { |
||||
desc: data.storeInfo, |
||||
title: data.storeName, |
||||
link: href, |
||||
imgUrl: data.image, |
||||
} |
||||
wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData'], configAppMessage) |
||||
.then(res => {}) |
||||
.catch(res => { |
||||
if (res.is_ready) { |
||||
res.wx.updateAppMessageShareData(configAppMessage) |
||||
res.wx.updateTimelineShareData(configAppMessage) |
||||
} |
||||
}) |
||||
}) |
||||
} else { |
||||
var configAppMessage = { |
||||
desc: data.storeInfo, |
||||
title: data.storeName, |
||||
link: href, |
||||
imgUrl: data.image, |
||||
} |
||||
wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData'], configAppMessage) |
||||
.then(res => {}) |
||||
.catch(res => { |
||||
if (res.is_ready) { |
||||
res.wx.updateAppMessageShareData(configAppMessage) |
||||
res.wx.updateTimelineShareData(configAppMessage) |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
}, |
||||
}, |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="less"> |
||||
.geoPage { |
||||
position: fixed; |
||||
width: 100%; |
||||
height: 100%; |
||||
top: 0; |
||||
z-index: 10000; |
||||
} |
||||
|
||||
.product-con .store-info { |
||||
margin-top: 0.2 * 100rpx; |
||||
background-color: #fff; |
||||
} |
||||
|
||||
.product-con .store-info .title { |
||||
padding: 0 0.3 * 100rpx; |
||||
font-size: 0.28 * 100rpx; |
||||
color: #282828; |
||||
height: 0.8 * 100rpx; |
||||
line-height: 0.8 * 100rpx; |
||||
border-bottom: 0.01 * 100rpx solid #f5f5f5; |
||||
} |
||||
|
||||
.product-con .store-info .info { |
||||
padding: 0 0.3 * 100rpx; |
||||
height: 1.26 * 100rpx; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt { |
||||
width: 100%; |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .pictrue { |
||||
width: 0.76 * 100rpx; |
||||
height: 0.76 * 100rpx; |
||||
margin-right: 0.2 * 100rpx; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .pictrue image { |
||||
width: 100%; |
||||
height: 100%; |
||||
border-radius: 0.06 * 100rpx; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .text { |
||||
flex: 1; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .text .name { |
||||
font-size: 0.3 * 100rpx; |
||||
color: #282828; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .text .address { |
||||
font-size: 0.24 * 100rpx; |
||||
color: #666; |
||||
margin-top: 0.03 * 100rpx; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .text .address .iconfont { |
||||
color: #707070; |
||||
font-size: 0.18 * 100rpx; |
||||
margin-left: 0.1 * 100rpx; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .addressBox { |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: flex-end; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .addressBox .iconfont { |
||||
font-size: 0.4 * 100rpx; |
||||
} |
||||
|
||||
.product-con .store-info .info .picTxt .addressBox .addressTxt { |
||||
font-size: 0.24 * 100rpx; |
||||
color: #eb3729; |
||||
} |
||||
|
||||
.product-con .store-info .praise { |
||||
font-size: 0.28 * 100rpx; |
||||
color: #808080; |
||||
} |
||||
|
||||
.product-con .store-info .praise .iconfont { |
||||
font-size: 0.28 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior { |
||||
background-color: #fff; |
||||
margin-top: 0.2 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .title { |
||||
height: 0.98 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .title image { |
||||
width: 0.3 * 100rpx; |
||||
height: 0.3 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .title .titleTxt { |
||||
margin: 0 0.2 * 100rpx; |
||||
font-size: 0.3 * 100rpx; |
||||
background-image: linear-gradient(to right, #f57a37 0%, #f21b07 100%); |
||||
background-image: -webkit-linear-gradient(to right, #f57a37 0%, #f21b07 100%); |
||||
background-image: -moz-linear-gradient(to right, #f57a37 0%, #f21b07 100%); |
||||
-webkit-background-clip: text; |
||||
-webkit-text-fill-color: transparent; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner { |
||||
width: 6.9 * 100rpx; |
||||
margin: 0 auto; |
||||
padding-bottom: 0.2 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .list { |
||||
width: 100%; |
||||
padding-bottom: 0.2 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .list .item { |
||||
width: 2.15 * 100rpx; |
||||
margin: 0 0.22 * 100rpx 0.3 * 100rpx 0; |
||||
font-size: 0.26 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .list .item:nth-of-type(3n) { |
||||
margin-right: 0; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .list .item .pictrue { |
||||
width: 100%; |
||||
height: 2.15 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .list .item .pictrue image { |
||||
width: 100%; |
||||
height: 100%; |
||||
border-radius: 0.06 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .list .item .name { |
||||
color: #282828; |
||||
margin-top: 0.12 * 100rpx; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .swiper-pagination-bullet { |
||||
background-color: #999; |
||||
} |
||||
|
||||
.product-con .superior .slider-banner .swiper-pagination-bullet-active { |
||||
background-color: #e93323; |
||||
} |
||||
|
||||
.mask { |
||||
-webkit-filter: blur(2px); |
||||
-moz-filter: blur(2px); |
||||
-ms-filter: blur(2px); |
||||
filter: blur(2px); |
||||
} |
||||
|
||||
.product-con .product-intro .conter view { |
||||
width: 100% !important; |
||||
} |
||||
|
||||
.generate-posters { |
||||
width: 100%; |
||||
height: 1.7 * 100rpx; |
||||
background-color: #fff; |
||||
position: fixed; |
||||
left: 0; |
||||
bottom: 0; |
||||
z-index: 99; |
||||
transform: translate3d(0, 100%, 0); |
||||
-webkit-transform: translate3d(0, 100%, 0); |
||||
-ms-transform: translate3d(0, 100%, 0); |
||||
-moz-transform: translate3d(0, 100%, 0); |
||||
-o-transform: translate3d(0, 100%, 0); |
||||
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); |
||||
-o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); |
||||
} |
||||
|
||||
.generate-posters.on { |
||||
transform: translate3d(0, 0, 0); |
||||
-webkit-transform: translate3d(0, 0, 0); |
||||
-ms-transform: translate3d(0, 0, 0); |
||||
-moz-transform: translate3d(0, 0, 0); |
||||
-o-transform: translate3d(0, 0, 0); |
||||
} |
||||
|
||||
.generate-posters .item { |
||||
flex: 50%; |
||||
-webkit-flex: 50%; |
||||
-ms-flex: 50%; |
||||
text-align: center; |
||||
} |
||||
|
||||
.generate-posters .item .iconfont { |
||||
font-size: 0.8 * 100rpx; |
||||
color: #5eae72; |
||||
} |
||||
|
||||
.generate-posters .item .iconfont.icon-haibao { |
||||
color: #5391f1; |
||||
} |
||||
|
||||
.noscroll { |
||||
height: 100%; |
||||
overflow: hidden; |
||||
} |
||||
.product-con .footer { |
||||
.in-bnt { |
||||
width: auto; |
||||
flex: 1; |
||||
margin-left: 30rpx; |
||||
& > view { |
||||
width: 100%; |
||||
border-radius: 50rpx; |
||||
} |
||||
} |
||||
} |
||||
</style> |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue