diff --git a/apis/index.js b/apis/index.js index bd0aeae..4d757e1 100644 --- a/apis/index.js +++ b/apis/index.js @@ -14,6 +14,7 @@ import order from "./interfaces/order" import company from "./interfaces/company" import home from "./interfaces/home" import ticket from "./interfaces/ticket" +import address from "./interfaces/address" export default{ publics, @@ -26,5 +27,6 @@ export default{ order, company, home, - ticket + ticket, + address } diff --git a/apis/interfaces/address.js b/apis/interfaces/address.js new file mode 100644 index 0000000..c5f394d --- /dev/null +++ b/apis/interfaces/address.js @@ -0,0 +1,24 @@ +/** + * 手太欠 + * 5g获客星光网 - 我的地址 + */ + +import {req} from "../request" + +const create = data => req({url: "user/addresses/create", data: data}) //获取省市区层级信息 +const index = () => req({url: "user/addresses"}) //我的地址列表 +const info = (address_id) => req({url: "user/addresses/" + address_id}) //地址列表-详情 +const add = data => req({url: "user/addresses", method: "POST", data: data}) //新增-地址列表 +const revise = (address_id, data) => req({url: "user/addresses/" + address_id, method: "PUT", data: data}) //修改-地址列表 +const del = (address_id) => req({url: "user/addresses/" + address_id, method: "DELETE"}) //地址列表-删除 +const def = (address_id) => req({url: "user/addresses/" + address_id + "/default", method: "POST"}) //地址列表-默认 + +export default({ + create, + index, + info, + add, + revise, + del, + def +}) diff --git a/apis/interfaces/mall.js b/apis/interfaces/mall.js index 9fb9b6c..fe9d751 100644 --- a/apis/interfaces/mall.js +++ b/apis/interfaces/mall.js @@ -4,6 +4,60 @@ */ import {req} from "../request" +const index = () => req({url: "shop/index"}) //商城首页 +const pushData = data => req({url: "goods/push", data: data}) //商城为您推荐 +const first = () => req({url: "shop/category/first"}) //商城分类-左侧 +const second = data => req({url: "shop/category/second", data: data}) //商城分类-右侧 +const hotData = data => req({url: "goods/hot", data: data}) //优惠热卖更多 +const freeData = data => req({url: "goods/free", data: data}) //免费券专区更多 +const hotkey = data => req({url: "shop/hotkey", data: data}) //热门关键字 +const lists = data => req({url: "goods/lists", data: data}) //全部商品列表 + +const details = (goods_id) => req({url: "goods/" + goods_id + '/show'}) //商品详情 +const grant = data => req({url: "coupons/grant", method: "POST", data: data}) //优惠券领取 +const jionCar = data => req({url: "carts/jion", method: "POST", data: data}) //加入购物车 +const carKist = () => req({url: "carts/index"}) //购物车列表 +const carRemove= data => req({url: "carts/remove", method: "POST", data: data}) //购物车移除商品 +const carClear = () => req({url: "carts/clear", method: "POST"}) //清空购物车 +const increment= (id) => req({url: "carts/" + id + "/increment", method: "POST"}) //购物车增加数量 +const decrement= (id) => req({url: "carts/" + id + "/decrement", method: "POST"}) //购物车减少数量 + +const coupon = data => req({url: "coupons", data: data}) //店铺优惠券列表 +const coupons = data => req({url: "user/coupons", data: data}) //我的优惠券 +const couponDetails = (user_coupon_id) => req({url: "user/coupons/" + user_coupon_id}) //我的优惠券详情 +const couponsGoods = data => req({url: "user/coupons/goods", data: data}) //可领取的商品 + +const orderSystem = data => req({url: "orders/goods/create", data: data}) //商品确认订单 +const orderBuy = data => req({url: "orders/goods/buy", method: "POST", data: data}) //商品确认提交 + +const cartSystem = data => req({url: "orders/carts/create",data: data}) //购物车确认订单 +const cartBuy = data => req({url: "orders/carts/buy", method: "POST", data: data}) //购物车确认订单 +const wechat = data => req({url: "payments/wechat", method: "POST", data: data}) //购物车确认订单 + export default({ - + index, + pushData, + first, + second, + hotData, + freeData, + hotkey, + lists, + details, + grant, + jionCar, + carKist, + carRemove, + carClear, + increment, + decrement, + coupon, + coupons, + couponDetails, + couponsGoods, + orderSystem, + orderBuy, + cartSystem, + cartBuy, + wechat }) diff --git a/apis/interfaces/order.js b/apis/interfaces/order.js index 08adaae..ab5ca7b 100644 --- a/apis/interfaces/order.js +++ b/apis/interfaces/order.js @@ -1,9 +1,16 @@ - -/* - * 订单 +/** + * 手太欠 + * 5g获客星光网 - 商城首页 */ + import {req} from "../request" +const index = () => req({url: "orders"}) //登录 +const cancel = (orderId) => req({url: "orders/cancel/" + orderId}) //取消订单 +const orders = (orderId) => req({url: "orders/" + orderId}) //订单-详情 + export default({ - -}) + index, + cancel, + orders +}) \ No newline at end of file diff --git a/components/mallIndex_coupon/mallIndex_coupon.js b/components/mallIndex_coupon/mallIndex_coupon.js new file mode 100644 index 0000000..9d6b8c9 --- /dev/null +++ b/components/mallIndex_coupon/mallIndex_coupon.js @@ -0,0 +1,32 @@ + +/** + * Web唐明明 + * 一个梦想做木雕手艺人的程序员 + * explain: userInfoLayer + */ + +Component({ + /** + * 组件的属性列表 + */ + properties:{ + freeCoupon:{ + type : Array, + value : [] + } + }, + + /** + * 组件的方法列表 + */ + methods: { + // 页面跳转 + jumpUrl(e) { + let id = e.currentTarget.dataset.id + wx.navigateTo({ + url : '/pages/mall_details/mall_details?id=' + id, + }) + } + }, + +}) diff --git a/components/mallIndex_coupon/mallIndex_coupon.json b/components/mallIndex_coupon/mallIndex_coupon.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/components/mallIndex_coupon/mallIndex_coupon.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/components/mallIndex_coupon/mallIndex_coupon.wxml b/components/mallIndex_coupon/mallIndex_coupon.wxml new file mode 100644 index 0000000..b0998e6 --- /dev/null +++ b/components/mallIndex_coupon/mallIndex_coupon.wxml @@ -0,0 +1,29 @@ + + + + + 免费券专区 + + + 更多 + + + + + + + + + {{item.title}} + + ¥{{item.prices.price}} + 协会 {{item.prices.association}} + + + vip + ¥{{item.prices.vip}} + + + + + \ No newline at end of file diff --git a/components/mallIndex_coupon/mallIndex_coupon.wxss b/components/mallIndex_coupon/mallIndex_coupon.wxss new file mode 100644 index 0000000..dba75e1 --- /dev/null +++ b/components/mallIndex_coupon/mallIndex_coupon.wxss @@ -0,0 +1,116 @@ +/* + * 手太欠 + * 企获客商城模块 + */ + + +/* 商城优惠券专区 */ +.coupon { + background-color: white; + border-radius: 10rpx; + padding: 20rpx; + box-sizing: border-box; + margin-top: 30rpx; +} + +.coupon-title { + display: flex; + margin-bottom: 20rpx; +} + +.coupon-name { + flex: 1; +} + +.coupon-more { + font-size: 30rpx; + color: #666666; + display: flex; +} + +.coupon-more-icon { + width: 34rpx; + height: 34rpx; + margin: 4rpx 0 0 10rpx; + vertical-align: middle; +} + +/* 优惠券列表 */ +.coupon-list { + white-space: nowrap; + margin: 30rpx 10rpx 0; + height: 340rpx; +} + +.coupon-label { + height: 340rpx; + width: 180rpx; + margin-right: 40rpx; + overflow: hidden; + display: inline-block; +} + +.coupon-label:last-child { + margin-right: 0; +} + +.coupon-img { + position: relative; + width: 100%; + padding-top: 100%; + margin: 0 auto; + border-radius: 10rpx; + margin-bottom: 20rpx; + overflow: hidden; +} + +.coupon-img image { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} + +.coupon-cont-tips { + display: flex; + font-size: 26rpx; + margin: 5rpx 0 10px; +} + +.coupon-cont-tips text { + display: block; + margin-right: 10rpx; + font-weight: 600; +} + +.coupon-cont-price { + font-size: 24rpx; + color: #999; +} + +.recommend-mark { + background-color: #f2e4c0; + border-radius: 6rpx; + display: inline-block; + font-size: 24rpx; + overflow: hidden; + height: 38rpx; + line-height: 38rpx; + padding-right: 10rpx; +} + +.recommend-vip { + display: inline-block; + line-height: 38rpx; + background-color: #333333; + color: #f2e4c0; + padding: 0 10rpx; +} + +.recommend-sell { + float: right; + font-size: 24rpx; + line-height: 38rpx; + color: #aaabab; +} \ No newline at end of file diff --git a/components/mallIndex_hot/mallIndex_hot.js b/components/mallIndex_hot/mallIndex_hot.js new file mode 100644 index 0000000..16ebfd5 --- /dev/null +++ b/components/mallIndex_hot/mallIndex_hot.js @@ -0,0 +1,29 @@ +/** + * 手太欠 + * 5g星光网-商城 + */ + +Component({ + /** + * 组件的属性列表 + */ + properties:{ + hotSale:{ + type : Array, + value : [] + } + }, + + /** + * 组件的方法列表 + */ + methods: { + // 页面跳转 + hotTap(e) { + let id = e.currentTarget.dataset.id + wx.navigateTo({ + url : '/pages/mall_details/mall_details?id=' + id, + }) + } + } +}) diff --git a/components/mallIndex_hot/mallIndex_hot.json b/components/mallIndex_hot/mallIndex_hot.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/components/mallIndex_hot/mallIndex_hot.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/components/mallIndex_hot/mallIndex_hot.wxml b/components/mallIndex_hot/mallIndex_hot.wxml new file mode 100644 index 0000000..eac459f --- /dev/null +++ b/components/mallIndex_hot/mallIndex_hot.wxml @@ -0,0 +1,24 @@ + + + + + 优惠热卖 + + + 更多 + + + + + + + {{item.title}} + ¥{{item.prices.price}}协会 ¥{{item.prices.association}} + + vip + ¥{{item.prices.vip}} + + + + + \ No newline at end of file diff --git a/components/mallIndex_hot/mallIndex_hot.wxss b/components/mallIndex_hot/mallIndex_hot.wxss new file mode 100644 index 0000000..4d7b87e --- /dev/null +++ b/components/mallIndex_hot/mallIndex_hot.wxss @@ -0,0 +1,120 @@ +/* + * 手太欠 + * 企获客商城模块 + */ + + +/* 商城优惠热卖 */ +.hot { + background-color: white; + border-radius: 10rpx; + padding: 20rpx; + box-sizing: border-box; + margin-top: 30rpx; +} + +.hot-title { + display: flex; + margin-bottom: 30rpx; +} + +.hot-name { + flex: 1; +} + +.hot-more { + font-size: 30rpx; + color: #666666; + display: flex; +} + +.hot-more-icon { + width: 34rpx; + height: 34rpx; + margin: 4rpx 0 0 10rpx; + vertical-align: middle; +} + +/* 热卖列表 */ +.hot-scroll { + white-space: nowrap; +} + +.hot-list { + width: 420rpx; + background-image: linear-gradient(to top, #fff, #fcf5f3); + border-radius: 10rpx; + display: inline-block; + position: relative; + padding: 20rpx; + box-sizing: border-box; + margin-right: 20rpx; + border: 2rpx #eeeeee dashed; +} + +.hot-list:last-child { + margin-right: 0; +} + +.hot-img { + width: 140rpx; + height: 140rpx; + border-radius: 10rpx; +} + +.hot-price { + color: #ea4e2f +} + +.hot-price text { + font-size: 24rpx; + line-height: 40rpx; +} + +.hot-cont { + position: absolute; + left: 180rpx; + top: 20rpx; + right: 20rpx; +} + +.hot-price { + margin: 10rpx 0; + font-size: 28rpx; + display: flex; +} + +.hot-cost { + font-size: 24rpx; + color: #999; + /* text-decoration:line-through; */ + margin-left: 20rpx; + line-height: 38rpx; +} + + +.recommend-mark { + background-color: #f2e4c0; + border-radius: 6rpx; + display: inline-block; + font-size: 24rpx; + overflow: hidden; + height: 38rpx; + line-height: 38rpx; + padding-right: 10rpx; +} + +.recommend-vip { + display: inline-block; + line-height: 38rpx; + background-color: #333333; + color: #f2e4c0; + padding: 0 10rpx; +} + +.recommend-sell { + float: right; + font-size: 24rpx; + line-height: 38rpx; + color: #aaabab; +} \ No newline at end of file diff --git a/components/mallIndex_list/mallIndex_list.js b/components/mallIndex_list/mallIndex_list.js new file mode 100644 index 0000000..b8e9f5c --- /dev/null +++ b/components/mallIndex_list/mallIndex_list.js @@ -0,0 +1,38 @@ + +/** + * 手太欠 + * 5g星光网-商城 + */ + +Component({ + /** + * 组件的属性列表 + */ + properties:{ + pushList :{ + type : Array, + value : [] + }, + lodingStats :{ + type : Boolean, + value : false + }, + hasMore :{ + type : Boolean, + value : false + }, + }, + + /** + * 组件的方法列表 + */ + methods: { + // 页面跳转 + push(e) { + let id = e.currentTarget.dataset.id + wx.navigateTo({ + url : '/pages/mall_details/mall_details?id=' + id, + }) + } + } +}) diff --git a/components/mallIndex_list/mallIndex_list.json b/components/mallIndex_list/mallIndex_list.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/components/mallIndex_list/mallIndex_list.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/components/mallIndex_list/mallIndex_list.wxml b/components/mallIndex_list/mallIndex_list.wxml new file mode 100644 index 0000000..800d169 --- /dev/null +++ b/components/mallIndex_list/mallIndex_list.wxml @@ -0,0 +1,43 @@ + + + + 为您推荐 + + + + + + + + + {{item.title}} + + + + ¥{{item.prices.price}} + + + 协会: ¥{{item.prices.association}} + + + + + vip + ¥{{item.prices.vip}} + + 已售{{item.sell_number}} + + + + + + + 加载中... + + + 没有更多了~ + + + + \ No newline at end of file diff --git a/components/mallIndex_list/mallIndex_list.wxss b/components/mallIndex_list/mallIndex_list.wxss new file mode 100644 index 0000000..af478e8 --- /dev/null +++ b/components/mallIndex_list/mallIndex_list.wxss @@ -0,0 +1,96 @@ +/* + * 手太欠 + * 企获客商城模块 + */ + + @import "/app.wxss"; + +/* 商城首页为您推荐 */ +.recommend { + margin-top: 30rpx; +} + +.recommend-title { + padding: 0 10rpx 30rpx; +} + +.recommend-list { + overflow: hidden; + margin: 0 -10rpx; +} + +.recommend-label { + float: left; + width: calc(50% - 20rpx); + margin: 0 10rpx 20rpx; + border-radius: 10rpx; + overflow: hidden; + background-color: white ; +} + +.recommend-img { + position: relative; + width: 100%; + padding-top: 100%; +} + +.recommend-img image { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.recommend-cont { + padding: 20rpx; + box-sizing: border-box; +} + +.recommend-price { + margin: 20rpx 0; + display: flex; + font-size: 28rpx; +} + +.recommend-ruling { + color: #ea4e2f; + font-weight: 600; +} + +.recommend-ruling text { + font-size: 24rpx; +} + +.recommend-cost { + font-size: 24rpx; + color: #999; + /* text-decoration:line-through; */ + margin: 2rpx 0 0 20rpx; +} + +.recommend-mark { + background-color: #f2e4c0; + border-radius: 6rpx; + display: inline-block; + font-size: 24rpx; + overflow: hidden; + height: 38rpx; + line-height: 38rpx; + padding-right: 10rpx; +} + +.recommend-vip { + display: inline-block; + line-height: 38rpx; + background-color: #333333; + color: #f2e4c0; + padding: 0 10rpx; +} + +.recommend-sell { + float: right; + font-size: 24rpx; + line-height: 38rpx; + color: #aaabab; +} \ No newline at end of file diff --git a/components/mallIndex_nav/mallIndex_nav.js b/components/mallIndex_nav/mallIndex_nav.js new file mode 100644 index 0000000..f42275b --- /dev/null +++ b/components/mallIndex_nav/mallIndex_nav.js @@ -0,0 +1,36 @@ +/** + * 手太欠 + * 5g星光网-商城 + */ + +Component({ + /** + * 组件的属性列表 + */ + properties:{ + categories:{ + type : Array, + value : [] + } + }, + + /** + * 组件的方法列表 + */ + methods: { + // 页面跳转 + handeItemTap(e) { + let id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '/pages/mall_goods/mall_goods?sort=' + id, + }) + }, + + // 查看更所分类 + homeTap() { + wx.navigateTo({ + url: '/pages/mall_classify/mall_classify', + }) + } + } +}) diff --git a/components/mallIndex_nav/mallIndex_nav.json b/components/mallIndex_nav/mallIndex_nav.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/components/mallIndex_nav/mallIndex_nav.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/components/mallIndex_nav/mallIndex_nav.wxml b/components/mallIndex_nav/mallIndex_nav.wxml new file mode 100644 index 0000000..ac32371 --- /dev/null +++ b/components/mallIndex_nav/mallIndex_nav.wxml @@ -0,0 +1,11 @@ + + + + + {{item.title}} + + + + 全部 + + \ No newline at end of file diff --git a/components/mallIndex_nav/mallIndex_nav.wxss b/components/mallIndex_nav/mallIndex_nav.wxss new file mode 100644 index 0000000..0ab860e --- /dev/null +++ b/components/mallIndex_nav/mallIndex_nav.wxss @@ -0,0 +1,33 @@ +/* + * 手太欠 + * 企获客商城模块 + */ + + +/* 商城分类 */ +.mallNav { + background-color: white; + border-radius: 20rpx; + margin-top: 30rpx; +} + +.mallNav { + overflow: hidden; + padding-top: 40rpx; +} + +.mallNav-label { + font-size: 28rpx; + color: #666666; + float: left; + text-align: center; + width: 25%; + margin-bottom: 40rpx; +} + +.mallNav-icon { + width: 70rpx; + height: 70rpx; + display: block; + margin: 0 auto 10rpx; +} \ No newline at end of file diff --git a/components/mallIndex_video/mallIndex_video.js b/components/mallIndex_video/mallIndex_video.js new file mode 100644 index 0000000..710de4d --- /dev/null +++ b/components/mallIndex_video/mallIndex_video.js @@ -0,0 +1,19 @@ +/** + * 手太欠 + * 5g星光网-商城 + */ + +Component({ + /** + * 组件的属性列表 + */ + properties:{ + + }, + + /** + * 组件的方法列表 + */ + methods: { + } +}) diff --git a/components/mallIndex_video/mallIndex_video.json b/components/mallIndex_video/mallIndex_video.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/components/mallIndex_video/mallIndex_video.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/components/mallIndex_video/mallIndex_video.wxml b/components/mallIndex_video/mallIndex_video.wxml new file mode 100644 index 0000000..1b5abd2 --- /dev/null +++ b/components/mallIndex_video/mallIndex_video.wxml @@ -0,0 +1,43 @@ + + \ No newline at end of file diff --git a/components/mallIndex_video/mallIndex_video.wxss b/components/mallIndex_video/mallIndex_video.wxss new file mode 100644 index 0000000..2a92c42 --- /dev/null +++ b/components/mallIndex_video/mallIndex_video.wxss @@ -0,0 +1,122 @@ +/* + * 手太欠 + * 企获客商城模块 + */ + + +/* 商城分类 */ +.video { + margin-top: 30rpx; +} + +.videoTitle { + display: flex; + padding: 0 10rpx 30rpx; +} + +.videoTitle-name { + flex: 1; + display: flex; +} + +.videoTitle-name-color { + background: linear-gradient(to right, #9756fa, #5079ff); + -webkit-background-clip: text; + color: transparent; + display: inline-block; + font-weight: 600; + margin-right: 20rpx; +} + +.videoTitle-name-img { + background-image: linear-gradient(to right, #9756fa, #5079ff); + color: #fff; + font-size: 24rpx; + border-radius: 50rpx; + display: flex; + width: 110rpx; + height: 37rpx; + line-height: 37rpx; + margin-top: 5rpx; +} + +.videoTitle-name-img image { + width: 34rpx; + height: 34rpx; + margin: 1rpx 6rpx 0 10rpx; +} + +.videoTitle-more { + font-size: 28rpx; + line-height: 40rpx; + color: #999; +} + +/* 列表 */ +.videoList { + overflow: hidden; + margin: 0 -10rpx; +} + +.videoList-label { + width: calc(50% - 20rpx); + margin: 0 10rpx; + float: left; + background-color: #fff; + border-radius: 20rpx; + overflow: hidden; +} + +.videoList-img { + position: relative; + width: 100%; + padding-top: 80%; +} + +.videoList-img .videoList-cover { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.videoList-tips { + position: absolute; + top: 20rpx; + left: 20rpx; + color: #fc6c27; + background-color: #f6f5f1; + border-radius: 40rpx; + font-size: 24rpx; + padding: 0 12rpx; + height: 44rpx; + line-height: 44rpx; + display: flex; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.videoList-tips image { + width: 30rpx; + height: 30rpx; + margin: 8rpx 10rpx 6rpx 0; +} + +.videoList-cont { + padding: 20rpx; + box-sizing: border-box; +} + +.videoList-user { + display: flex; + line-height: 46rpx; + font-size: 28rpx; + margin-top: 20rpx; + color: #999; +} + +.videoList-head { + width: 46rpx; + height: 46rpx; + margin-right: 20rpx; +} diff --git a/pages/mall/index.js b/pages/mall/index.js index eb795c7..ee82216 100644 --- a/pages/mall/index.js +++ b/pages/mall/index.js @@ -1,66 +1,90 @@ -// pages/mall/index.js -Page({ +/** + * 手太欠 + * 5g获客星光网 - 商城 + */ +const data = require("../../data/demo") + +Page({ /** * 页面的初始数据 */ data: { - + banners : [], //banner图 + categories : [], //分类 + freeCoupon : [], //免费劵商品列表 + hotSale : [], //优惠热爱列表 + pushList : [], //推荐商品列表 + page : {}, //分页信息 + lodingStats : false //加载状态 }, /** * 生命周期函数--监听页面加载 */ - onLoad: function (options) { + onLoad(){ + // 获取商城首页数据 + this.indexInfo(); + // 获取为您推荐 + this.pushInfo(); }, /** - * 生命周期函数--监听页面初次渲染完成 + * 商城首页数据 */ - onReady: function () { - + indexInfo () { + wx.$api.mall.index().then(res=>{ + this.setData({ + banners : res.banners, + categories : res.categories, + freeCoupon : res.free_coupon, + hotSale : res.hot_sale + }) + }) }, /** - * 生命周期函数--监听页面显示 + * 为您推荐 */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - + pushInfo(page) { + wx.$api.mall.pushData({ + page : page, + pagesize: 15 + }).then(res=>{ + let listArr = this.data.pushList, + newData = [] + if(page == 1 || page == undefined) listArr = [] + newData = listArr.concat(res.data) + this.setData({ + pushList : newData, + page : res.page, + lodingStats : false + }) + wx.stopPullDownRefresh() + }) }, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh: function () { - + onPullDownRefresh() { + // 获取为您推荐 + this.pushInfo(); }, /** - * 页面上拉触底事件的处理函数 + * 上拉加载 */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - + onReachBottom(){ + this.setData({ + lodingStats: true + }) + let pageNumber = this.data.page.current + if(this.data.page.has_more){ + pageNumber++ + // 获取为您推荐 + this.pushInfo(pageNumber); + } } }) \ No newline at end of file diff --git a/pages/mall/index.json b/pages/mall/index.json index 8835af0..e022b9a 100644 --- a/pages/mall/index.json +++ b/pages/mall/index.json @@ -1,3 +1,11 @@ { - "usingComponents": {} + "usingComponents": { + "mallIndex_nav" : "/components/mallIndex_nav/mallIndex_nav", + "mallIndex_coupon" : "/components/mallIndex_coupon/mallIndex_coupon", + "mallIndex_hot" : "/components/mallIndex_hot/mallIndex_hot", + "mallIndex_list" : "/components/mallIndex_list/mallIndex_list", + "mallIndex_video" : "/components/mallIndex_video/mallIndex_video" + }, + "navigationBarTitleText": "商城", + "enablePullDownRefresh" : true } \ No newline at end of file diff --git a/pages/mall/index.wxml b/pages/mall/index.wxml index 93fe9d4..50f298e 100644 --- a/pages/mall/index.wxml +++ b/pages/mall/index.wxml @@ -1,2 +1,41 @@ - -pages/mall/index.wxml + + + + + + + 搜索商品 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/mall/index.wxss b/pages/mall/index.wxss index 0d35e2f..3ef2d27 100644 --- a/pages/mall/index.wxss +++ b/pages/mall/index.wxss @@ -1 +1,75 @@ -/* pages/mall/index.wxss */ \ No newline at end of file +/* + * 手太欠 + * 企获客商城模块 + */ + + +page { + background-color: #f3f3f3; +} + +/* 商城红色背景 */ +.mallBox { + position: relative; +} + +.mallBox::after { + position: absolute; + content: ''; + background-color: #ea4e2f; + border-radius: 0 0 10% 10%; + width: 100%; + height: 38vh; + top: 0; + left: 0; + z-index: 0; +} + +.mallCont { + position: absolute; + left: 30rpx; + top: 30rpx; + right: 30rpx; + z-index: 1; +} + +/* 商城搜索 */ +.mallCont-search { + background-color: white; + border-radius: 100rpx; + padding: 18rpx 30rpx; + box-sizing: border-box; + display: flex; + color: #999999; +} + +.mallCont-search-icon { + width: 44rpx; + height: 44rpx; + margin-right: 30rpx; +} + +/* 轮播图 */ +.banner { + position: relative; + padding-top: 38%; + width: 100%; + background: white; + border-radius: 10rpx; + overflow: hidden; + margin: 30rpx 0; +} + +.banner-swiper { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.banner-img { + width: 100%; + height: 100%; + vertical-align: top; +} \ No newline at end of file diff --git a/pages/mall/mall_address/mall_address.js b/pages/mall/mall_address/mall_address.js new file mode 100644 index 0000000..a8688e6 --- /dev/null +++ b/pages/mall/mall_address/mall_address.js @@ -0,0 +1,100 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + addressType : '', //类型 selectAddress为选择地址 + addressArr : [], //收货地址列表 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + console.log(options) + this.setData({ + addressType : options.type + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow () { + // 获取地址列表 + this.addressInfo(); + }, + + /** + * 地址列表 + */ + addressInfo () { + wx.$api.address.index().then(res=>{ + this.setData({ + addressArr : res + }) + }) + }, + + /** + * 删除地址 + */ + addressRemove(e){ + let id = e.target.dataset.id, + index = e.target.dataset.index, + list = this.data.addressArr + + list.splice(index,1) + + wx.showModal({ + title : '提示', + content : '是否删除地址', + success : res=> { + if (res.confirm) { + wx.showLoading({ + title: '删除中', + }) + wx.$api.address.del(id).then(res=>{ + this.setData({ + addressArr: list + }) + wx.hideLoading() + }) + } + } + }) + }, + + /** + * 设为默认地址 + */ + addressDefault(e){ + let id = e.currentTarget.dataset.id + wx.$api.address.def(id).then(res=>{ + // 获取地址列表 + this.addressInfo(); + }) + }, + + /** + * 选择地址 + */ + selectAddress(e){ + let atAdds = this.data.addressArr[e.currentTarget.dataset.index] + let pages = getCurrentPages(), + prepage = pages[pages.length-2] + + prepage.setData({ + addressDel: atAdds + }) + + wx.navigateBack() + } +}) \ No newline at end of file diff --git a/pages/mall/mall_address/mall_address.json b/pages/mall/mall_address/mall_address.json new file mode 100644 index 0000000..4702470 --- /dev/null +++ b/pages/mall/mall_address/mall_address.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "我的地址" +} \ No newline at end of file diff --git a/pages/mall/mall_address/mall_address.wxml b/pages/mall/mall_address/mall_address.wxml new file mode 100644 index 0000000..b2cae66 --- /dev/null +++ b/pages/mall/mall_address/mall_address.wxml @@ -0,0 +1,46 @@ + + + + + {{item.name}}{{item.mobile}} + 默认 + + + + + {{item.full_address}} + + + 设为默认地址 + + + + + 默认地址 + + + + + + 选择地址 + + + + + + + + + + + + + + + 还未添加收货地址 + + + + 添加地址 + \ No newline at end of file diff --git a/pages/mall/mall_address/mall_address.wxss b/pages/mall/mall_address/mall_address.wxss new file mode 100644 index 0000000..fb9fafd --- /dev/null +++ b/pages/mall/mall_address/mall_address.wxss @@ -0,0 +1,124 @@ +/* + * 手太欠 + * 企获客商城模块 + */ + page { + background-color: #f7f7f7; + } + + .address{ + border-bottom: 130rpx solid transparent; +} + +/* 地址列表 */ +.address-list { + background: #fff; + padding: 30rpx; + box-sizing: border-box; + overflow: hidden; +} + +.address-name { + display: flex; +} + +.address-name>text{ + padding-left: 40rpx; +} + +.address-state { + margin-left: 20rpx; +} + +.address-state text { + font-size: 24rpx; + height: 40rpx; + line-height: 40rpx; + border-radius: 50rpx; + padding: 0 10rpx; + background-color: #c3c3c3; + color: #fff; + display: inline-block; + transform:scale(0.85); +} + +.address-state text.active { + background-color: #ea4e2f; +} + +.address-text { + color: #666666; + font-size: 28rpx; + margin: 20rpx 0; +} + +.address-default{ + height: 46rpx; + line-height: 44rpx; + border-radius: 6rpx; + font-size: 28rpx; + color:#666666; +} + +.address-default image { + width: 34rpx; + height: 34rpx; + margin-right: 10rpx; + vertical-align: -6rpx; +} + +.address-cont { + display: flex; +} + +.address-site { + width: calc(100% - 180rpx) +} + +.address-tool { + display: flex; + width: 172rpx; + margin-top: 48rpx; +} + +.address-tool image { + width: 36rpx; + height: 36rpx; + margin-left: 50rpx; +} + +.address-tool-btn{ + margin-left: 30rpx; + border:solid 1rpx #747788; + height: 56rpx; + line-height: 54rpx; + padding: 0 20rpx; + font-size: 24rpx; +} + +/* footer */ + +.address-footer{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding-left: 30rpx; + padding-right: 30rpx; + background: white; + border-top: 2rpx solid #eeeeee; + z-index: 9; + height: 130rpx; +} + +.address-footer navigator{ + width: 100%; + line-height: 90rpx; + height: 90rpx; + margin: 20rpx 0; + text-align: center; + background: #224bf6; + font-size: 30rpx; + color: white; + border-radius: 60rpx; +} diff --git a/pages/mall/mall_address_form/mall_address_form.js b/pages/mall/mall_address_form/mall_address_form.js new file mode 100644 index 0000000..58939bb --- /dev/null +++ b/pages/mall/mall_address_form/mall_address_form.js @@ -0,0 +1,234 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + id : '', //列表id + stateType : '', //类型 Add为添加地址 compile为编辑地址 + saveArr : [], //省级列表 + saveIndex : 0, //省级index + saveId : 0, //省级id + cityArr : [], //城市列表 + cityIndex : 0, //城市index + cityId : 0, //城市id + regiArr : [], //区域列表 + regiIndex : 0, //区域index + regiId : 0, //区域id + defaultVal : '', //是否为默认地址 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + stateType : options.type, + id : options.id + }) + + if (options.type == 'Add') { + wx.setNavigationBarTitle({ + title: '添加收货地址' + }) + // 获取省级信息列表 + this.getProvince() + } else if (options.type == 'Compile') { + wx.setNavigationBarTitle({ + title: '编辑收货地址' + }) + // 获取地址编辑信息 + this.getUserAddress(options.id) + } + }, + + /** + * 地址编辑信息 + */ + getUserAddress(id){ + wx.$api.address.info(id).then(res=>{ + this.setData({ + name : res.name, + mobile : res.mobile, + address : res.address, + defaultVal : res.default + }) + + let cityArr = [ + res.province, + res.city, + res.district + ] + + this.getProvince(cityArr) + }) + }, + + /** + * 省级信息列表 + */ + getProvince(city) { + wx.$api.address.create().then(res=>{ + let saveArr = res, + saveIndex = this.data.saveIndex + this.setData({ + saveArr : saveArr, + saveId : saveArr[saveIndex].id, + }) + + if(city){ + // 获取市级列表 + this.citylist(city[0].id, city) + this.setData({ + saveIndex: res.findIndex(val => val.id == city[0].id), + saveId : city[0].id + }) + + }else{ + // 获取市级列表 + this.citylist(saveArr[saveIndex].id) + } + }) + }, + + /** + * 省份选择-筛选 + */ + areasChange(e) { + let save = this.data.saveArr, + index = e.detail.value, + atsave = save[index].id + if (index != this.data.saveIndex) { + this.setData({ + saveIndex : index, + saveId : atsave + }) + + // 获取市级列表 + this.citylist(atsave) + } + }, + + /** + * 市级列表 + */ + citylist(id, city) { + wx.$api.address.create({parent_id: id}).then(res=>{ + let cityArr = res + this.setData({ + cityArr : cityArr, + cityId : cityArr[0].id, + cityIndex : 0 + }) + + if(city){ + // 获取区域列表 + this.regilist(city[1].id, city) + this.setData({ + cityIndex: res.findIndex(val => val.id == city[1].id), + cityId : city[1].id + }) + }else{ + // 获取区域列表 + this.regilist(cityArr[0].id) + } + }) + }, + + /** + * 城市选择-筛选 + */ + city(e) { + let city = this.data.cityArr, + index = e.detail.value, + atcity = city[index].id + if (index != this.data.saveIndex) { + this.setData({ + cityIndex: index, + cityId : atcity + }) + + // 获取市级列表 + this.regilist(atcity) + } + }, + + /** + * 区域列表 + */ + regilist(id, city) { + wx.$api.address.create({parent_id: id}).then(res=>{ + this.setData({ + regiArr : res, + regiId : res[0].id, + regiIndex : 0 + }) + if(city){ + this.setData({ + regiIndex: res.findIndex(val => val.id == city[2].id), + regiId : city[2].id + }) + } + }) + }, + + /** + * 区域选择-筛选 + */ + regi(e) { + let newIndex = e.detail.value + this.setData({ + regiIndex : newIndex, + regiId : this.data.regiArr[newIndex].id + }) + }, + + /** + * 保存信息 + */ + siteform(e) { + if(this.data.stateType == 'Compile') { + // 编辑地址 + wx.$api.address.revise(this.data.id,{ + name : e.detail.value.name, + mobile : e.detail.value.mobile, + province_id : this.data.saveId, + city_id : this.data.cityId, + district_id : this.data.regiId, + address : e.detail.value.address, + is_default : this.data.defaultVal + }).then(res=>{ + wx.navigateBack() + }) + }else if(this.data.stateType == 'Add') { + // 创建地址 + wx.$api.address.add({ + name : e.detail.value.name, + mobile : e.detail.value.mobile, + province_id : this.data.saveId, + city_id : this.data.cityId, + district_id : this.data.regiId, + address : e.detail.value.address, + is_default : this.data.defaultVal + }).then(res=>{ + wx.navigateBack() + }) + } + }, + + /** + * 设为默认地址 + */ + addressDefault(e) { + let val = e.detail.value + this.setData({ + defaultVal: val + }) + } +}) \ No newline at end of file diff --git a/pages/mall/mall_address_form/mall_address_form.json b/pages/mall/mall_address_form/mall_address_form.json new file mode 100644 index 0000000..0d3d5a1 --- /dev/null +++ b/pages/mall/mall_address_form/mall_address_form.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "" +} \ No newline at end of file diff --git a/pages/mall/mall_address_form/mall_address_form.wxml b/pages/mall/mall_address_form/mall_address_form.wxml new file mode 100644 index 0000000..21731e3 --- /dev/null +++ b/pages/mall/mall_address_form/mall_address_form.wxml @@ -0,0 +1,77 @@ +
+ + + + + + + + + + + + + {{saveArr[saveIndex].name}} + + + + + + + + + {{cityArr[cityIndex].name}} + + + + + + + + + {{regiArr[regiIndex].name}} + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/pages/mall/mall_address_form/mall_address_form.wxss b/pages/mall/mall_address_form/mall_address_form.wxss new file mode 100644 index 0000000..f6192f2 --- /dev/null +++ b/pages/mall/mall_address_form/mall_address_form.wxss @@ -0,0 +1,181 @@ + +/** + * 手太欠 + * 物业小程序 + */ + + .site-form { + background: white; + display: block; +} + +.site-input{ + padding: 0 30rpx 0 200rpx; + position: relative; + line-height: 100rpx; + min-height: 100rpx; +} + +.site-input label{ + width: 220rpx; + position: absolute; + left: 30rpx; + top: 0; + display: flex; +} + +.site-input image { + width: 28rpx; + height: 28rpx; + position: absolute; + right: 20rpx; + top: calc(50% - 14rpx); +} + +.site-input input, +.site-input picker{ + padding-left: 60rpx; + height: 100rpx; +} + +.site-switch switch { + position: absolute; + right: 20rpx; + top: 0; +} + +.site-input::before{ + position: absolute; + bottom: 0; + left: 30rpx; + right: 0; + height: 1rpx; + content: ""; + background: #e4e6f2; +} + +.site-input:last-child::before{ + display: none; +} + +.tui-picker-detail{ + width: 33%; +} + +.siteTag { + display: flex; + margin: 50rpx 30rpx; +} + +.siteTag-title { + margin-right: 20rpx; +} + +.siteTag-label { + display: flex; +} + +.siteTag-label text { + display: inline-block; + background-color: #eeeeee; + border-radius: 50rpx; + font-size: 26rpx; + padding: 6rpx 25rpx; + margin-left: 30rpx; +} + +.siteTag-label text.active { + background-color: #224bf6; + color: #fff; +} + +/* footer */ + +.address-footer{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding-left: 30rpx; + padding-right: 30rpx; + background: white; + border-top: 2rpx solid #eeeeee; + z-index: 9; + height: 130rpx; +} + +.address-footer button[size="mini"]{ + width: 100%; + line-height: 90rpx; + height: 90rpx; + margin: 20rpx 0; + text-align: center; + background: #224bf6; + font-size: 30rpx; + color: white; + border-radius: 60rpx; +} + +/* pickerView */ + +.pickerView-back{ + background: rgba(0, 0, 0, .3); + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: none; +} + +.pickerView-back.active{ + display: block; +} + +.pickerView-layer{ + position: fixed; + bottom: -571rpx; + left: 0; + width: 100%; + background: white; + transition: all .3s; +} + +.pickerView-layer.active{ + bottom: 0; +} + +.pickerView-btn{ + line-height: 90rpx; + font-size: 30rpx; + padding: 0 30rpx; + display: flex; + justify-content:space-between; +} + +.pickerView{ + height: 480rpx; + padding: 0 10rpx; +} + +.pickerView-name{ + line-height: 80rpx; + padding: 0 20rpx; + text-align: center; +} + +.pickerView-mask{ + border-top: solid 1rpx #e4e6f2; +} + +.pickerView-indicator{ + height: 80rpx; +} + +.pickerView-determine{ + color: #3ec28e; +} + +.pickerView-cancel{ + color: #747788; +} diff --git a/pages/mall/mall_assess/mall_assess.js b/pages/mall/mall_assess/mall_assess.js new file mode 100644 index 0000000..585d276 --- /dev/null +++ b/pages/mall/mall_assess/mall_assess.js @@ -0,0 +1,23 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + commentArr: [], //商品评价列表 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + }, +}) \ No newline at end of file diff --git a/pages/mall/mall_assess/mall_assess.json b/pages/mall/mall_assess/mall_assess.json new file mode 100644 index 0000000..56bb8a3 --- /dev/null +++ b/pages/mall/mall_assess/mall_assess.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "评价列表" +} \ No newline at end of file diff --git a/pages/mall/mall_assess/mall_assess.wxml b/pages/mall/mall_assess/mall_assess.wxml new file mode 100644 index 0000000..8a01f13 --- /dev/null +++ b/pages/mall/mall_assess/mall_assess.wxml @@ -0,0 +1,39 @@ + + + + 全部 + 最新 + 图片视频 + + + + + + + + + 张慢慢呀 + 2020-12-04 + + + + + 真的是太棒了,很满意的一次购物,真好,很喜欢 + + + + + + + + + + \ No newline at end of file diff --git a/pages/mall/mall_assess/mall_assess.wxss b/pages/mall/mall_assess/mall_assess.wxss new file mode 100644 index 0000000..2ed87ef --- /dev/null +++ b/pages/mall/mall_assess/mall_assess.wxss @@ -0,0 +1,101 @@ +/* + * 手太欠 + * 企获客商城 + */ + page { + background-color: #f7f7f7; + } + +/* 评价标签 */ +.assessTag { + background-color: white; + white-space: nowrap; + margin-bottom: 20rpx; + padding: 20rpx; +} + +.assessTag text { + display: inline-block; + font-size: 28rpx; + background-color: #e6e8f0; + line-height: 60rpx; + padding: 0 30rpx; + border-radius: 40rpx; + margin: 15rpx; +} + +.assessTag text.active { + background-color: #56669a; + color: #fff; +} + +/* 评价列表 */ +.assessList { + padding: 20rpx; + box-sizing: border-box; + background: #fff; + margin-bottom: 20rpx; +} + +.assessList:last-child::after { + display: none; +} + +.assessList-top { + display: flex; + line-height: 80rpx; + margin: 30rpx 0 20rpx; +} + +.assessList-cont { + display: flex; + flex: 1; + width: calc(100% - 100rpx); +} + +.assessList-img { + width: 80rpx; + height: 80rpx; + border-radius: 50%; + margin-right: 20rpx; +} + +.assessList-name { + flex: 1; + font-weight: 600; +} + +.assessList-time { + color: #999; + font-size: 26rpx; +} + +.assessList-text { + font-size: 26rpx; + line-height: 40rpx; +} + + +.assessList-float { + width: 100%; + white-space: nowrap; + margin: 20rpx 0 0; +} + +.assessList-picture { + width: 150rpx; + display: inline-block; + height: 150rpx; + position: relative; + margin-right: 20rpx; + border-radius: 4rpx; + overflow: hidden; +} + +.assessList-picture image { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/pages/mall/mall_assess_form/mall_assess_form.js b/pages/mall/mall_assess_form/mall_assess_form.js new file mode 100644 index 0000000..9ef8e3d --- /dev/null +++ b/pages/mall/mall_assess_form/mall_assess_form.js @@ -0,0 +1,41 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + num : 4,//后端给的分数,显示相应的星星 + one_2 : 0, + two_2 : 5 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + }, + + //情况二:用户给评分 + in_xin(e){ + var in_xin = e.currentTarget.dataset.in; + var one_2; + if (in_xin === 'use_sc2'){ + one_2 = Number(e.currentTarget.id); + } else { + one_2 = Number(e.currentTarget.id) + this.data.one_2; + } + this.setData({ + one_2: one_2, + two_2: 5 - one_2 + }) + } + +}) \ No newline at end of file diff --git a/pages/mall/mall_assess_form/mall_assess_form.json b/pages/mall/mall_assess_form/mall_assess_form.json new file mode 100644 index 0000000..d4ebcc8 --- /dev/null +++ b/pages/mall/mall_assess_form/mall_assess_form.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "商品评价" +} \ No newline at end of file diff --git a/pages/mall/mall_assess_form/mall_assess_form.wxml b/pages/mall/mall_assess_form/mall_assess_form.wxml new file mode 100644 index 0000000..0793f1c --- /dev/null +++ b/pages/mall/mall_assess_form/mall_assess_form.wxml @@ -0,0 +1,54 @@ + + + + + + 商品名称哦 + + + + + + + + + + + + + {{one_2}}星 + + + + +
+ + + + + + + + 商品总价 + ¥{{amount}} + + + 优惠 + + {{coupon_id == 0 ? '请选择优惠券' : choiceTitle}} + + + + + 应付总价 + ¥{{amount - allAmount}} + + + + + + + + 合计: + ¥{{amount - allAmount}}元 + + + + + + + + + 优惠 + + + 可使用优惠券 + + + 代金劵 + + {{item.price}} + + + 商品代金券满{{item.full}}元可用金额可减{{item.price}}元 + + + + + 2020.11.01 - 2020.11.10 + + + + \ No newline at end of file diff --git a/pages/mall/mall_order_submit/mall_order_submit.wxss b/pages/mall/mall_order_submit/mall_order_submit.wxss new file mode 100644 index 0000000..c52cafe --- /dev/null +++ b/pages/mall/mall_order_submit/mall_order_submit.wxss @@ -0,0 +1,459 @@ +/* + * 手太欠 + * 企获客商城 + */ + +page { + background-color: #f7f7f7; +} + +.order-content { + border-bottom: solid 120rpx transparent; +} + +/* 收货地址 */ +.order-address { + padding: 30rpx 80rpx 40rpx 30rpx; + position: relative; + background: white; +} + +.order-address-back { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + vertical-align: bottom; +} + +.order-address-name { + padding-right: 300rpx; + position: relative; + font-size: 33rpx; + padding-bottom: 10rpx; +} + +.order-address-name text { + padding-right: 30rpx; +} + +.order-address-text { + color: #464854; + font-size: 26rpx; +} + +.arrows-right { + position: absolute; + height: 28rpx; + width: 28rpx; + right: 30rpx; + top: calc(50% - 19rpx); + top: -webkit-calc(50% - 19rpx); +} + +.order-add-address { + text-align: center; + padding: 30rpx 0; +} + +.order-add-address navigator { + display: inline-block; + background: #e92344; + color: white; + line-height: 60rpx; + padding: 0 30rpx; + margin-right: 20rpx; +} + +.arrows-add { + text-align: center; + width: 100%; +} + +/* 商品信息 */ + +.order-goods { + border-top: solid 20rpx #f2f2f2; +} + +.goods-goods-mall { + padding: 20rpx 30rpx 0 30rpx; + line-height: 50rpx; +} + +.goods-goods-mall image { + width: 48rpx; + height: 48rpx; + vertical-align: middle; + margin-right: 15rpx; + margin-bottom: 2rpx; +} + +.goods-goods-li { + padding: 20rpx 30rpx; + position: relative; + border-bottom: solid 1rpx #f2f2f2; + min-height: 160rpx; + background: white; +} + +.goods-goods-li:last-child { + border-bottom: none; +} + +.goods-img { + position: absolute; + top: 20rpx; + left: 30rpx; + height: 160rpx; + width: 160rpx; + background: #f5f6fa; +} + +.goods-body { + padding-left: 190rpx; +} + +.goods-name { + padding-bottom: 20rpx; +} + +.goods-price { + color: gray; + display: flex; +} + +.goods-qty { + color: #e92344; + font-size: 32rpx; + flex: 1; +} + +.goods-params { + color: gray; + padding-bottom: 20rpx; + font-size: 28rpx; +} + +/* 统计信息 */ + +.order-total { + background: white; + border-top: solid 20rpx #f2f2f2; +} + +.order-total-li { + padding: 20rpx 30rpx; + display: flex; + position: relative; +} + +.coupon-picker-icon { + position: absolute; + height: 28rpx; + width: 28rpx; + right: 30rpx; + top: calc(50% - 14rpx); +} + +.coupon-picker-icon { + position: absolute; + height: 28rpx; + width: 28rpx; + right: 30rpx; + top: calc(50% - 14rpx); +} + +.coupon-picker-text { + text-align: right; + color: gray; + padding-right: 40rpx; +} + +.coupon-picker-red { + color: #ea4e2f; +} + +.order-total-name { + flex: 1; +} + +.order-total-li text { + color: #999; +} + +.order-total-textarea { + width: 200rpx; + height: 80rpx; +} + + +.order-total-li textarea { + line-height: 50rpx; + height: 100rpx; +} + + +/* 底部工具栏 */ + +.order-footer { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + border-top: solid 1rpx #f2f2f2; + height: 100rpx; + line-height: 100rpx; + z-index: 99; + background: white; +} + +.order-footer-total { + padding-right: calc(30vw + 30rpx); + padding-right: -webkit-calc(30vw + 30rpx); + padding-left: 30rpx; + color: #737787; + font-size: 28rpx; +} + +.order-footer-total text { + color: #e92344; +} + +.order-footer-total-price { + font-size: 32rpx; +} + +.order-footer-btn[size="mini"] { + width: 40vw; + background: #eb532a; + color: white; + border-radius: 0; + height: 80rpx; + line-height: 80rpx; + font-size: 28rpx; + position: absolute; + top: 10rpx; + right: 10rpx; + border-radius: 50rpx; +} + +.order-footer-btn:after { + border: none; +} + +/* 选择优惠券弹出层 */ +.couponBack{ + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, .5); + z-index: 100; + display: none; +} + +.couponBack.active{ + display: block; +} + +.couponEject { + position: fixed; + width: 100%; + bottom: -100%; + left: 0; + border-radius: 30rpx 30rpx 0 0; + background-color: white; + z-index: 101; + transition: .2s; +} + +.couponEject.active { + bottom: 0; +} + +.couponEject-list { + padding: 30rpx; + box-sizing: border-box; +} + +.couponEject-list-title { + margin-bottom: 30rpx; +} + +.couponClose { + width: 40rpx; + height: 40rpx; + position: absolute; + top: 30rpx; + right: 30rpx; + z-index: 103; +} + +.couponEject-title { + text-align: center; + width: 100%; + padding: 30rpx 0 10rpx; + font-weight: 600; +} + +.couponDraw-list-label { + position: relative; + width: 100%; + padding-top: 32%; + border: 2rpx solid #eeeeee; + border-radius: 10rpx; + margin-bottom: 30rpx; +} + +.couponDraw-list-label::after, +.couponDraw-list-label::before { + position: absolute; + content: ''; + width: 30rpx; + height: 30rpx; + border-radius: 50%; + background-color: white; + z-index: 111; +} + +.couponEject-list-label::after { + top: -15rpx; + right: 160rpx; +} + +.couponEject-list-label::before { + bottom: -15rpx; + right: 160rpx; +} + + +.couponDraw-list-label::after { + top: -15rpx; + left: calc(40% - 15rpx); +} + +.couponDraw-list-label::before { + bottom: -15rpx; + left: calc(40% - 15rpx); +} + +.couponDraw-list-tips { + position: absolute; + top: 0; + left: 0; + z-index: 102; + font-size: 26rpx; + border-radius: 10rpx 0 10rpx 0; + padding: 6rpx 20rpx; + background-color: #fae5c2; + color: #9b6404; +} + +.couponDraw-list-price { + width: 40%; + background-color: #eea931; + color: #fff; + position: absolute; + height: 100%; + left: 0; + top: 0; + border-radius: 10rpx 0 0 10rpx; + text-align: center; +} + +.couponDraw-list-part { + position: absolute; + width: 100%; + height: 70rpx; + top: calc(50% - 35rpx); + z-index: 102; + text-align: center; + font-size: 50rpx; + font-weight: 600; +} + +.couponDraw-list-text { + position: absolute; + right: 0; + top: 0; + width: 60%; + padding: 10rpx 20rpx; + box-sizing: border-box; + background-color: #fff; + height: 100%; +} + +.couponDraw-list-name text { + color: #999; + display: block; + font-size: 26rpx; + margin: 10rpx 0 5rpx; +} + +.couponDraw-list-btn { + color: #b67c18; + position: absolute; + top: 90rpx; + right: 20rpx; + margin-bottom: 20rpx; +} + +.couponDraw-list-btn image { + width: 40rpx; + height: 40rpx; +} + +.couponDraw-list-time { + font-size: 26rpx; + color: #999; + clear: both; + position: absolute; + bottom: 20rpx; +} + +.couponDraw-list-red .couponDraw-list-price { + background-color: #ee3158; +} + +.couponDraw-list-red .couponDraw-list-tips { + background-color: #fac2cd; + color: #94001f; +} + + +.couponDraw-list-blue .couponDraw-list-price { + background-color: #2d6bf6; +} + +.couponDraw-list-blue .couponDraw-list-tips { + background-color: #c0d3fc; + color: #2151f5; +} + +.arrows-add-img { + width: 40rpx; + height: 40rpx; + vertical-align: middle; + margin: -8rpx 6rpx 0 0; +} + +.addressDef, .seTup { + display: inline-block; + font-size: 24rpx; + border-radius: 6rpx; + margin-top: 10rpx; + color: #e92344; + border: 2rpx solid #e92344; +} + +.addressDef { + padding: 0 10rpx; + height: 32rpx; + line-height: 32rpx; +} + +.seTup { + padding: 4rpx 10rpx; +} \ No newline at end of file diff --git a/pages/mall/mall_pay/mall_pay.js b/pages/mall/mall_pay/mall_pay.js new file mode 100644 index 0000000..825ff46 --- /dev/null +++ b/pages/mall/mall_pay/mall_pay.js @@ -0,0 +1,30 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + }, + + /** + * 订单支付 + */ + payment() { + wx.redirectTo({ + url: '/pages/mall_order_data/mall_order_data', + }) + } +}) \ No newline at end of file diff --git a/pages/mall/mall_pay/mall_pay.json b/pages/mall/mall_pay/mall_pay.json new file mode 100644 index 0000000..4b07a8f --- /dev/null +++ b/pages/mall/mall_pay/mall_pay.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "订单支付" +} \ No newline at end of file diff --git a/pages/mall/mall_pay/mall_pay.wxml b/pages/mall/mall_pay/mall_pay.wxml new file mode 100644 index 0000000..5ee0586 --- /dev/null +++ b/pages/mall/mall_pay/mall_pay.wxml @@ -0,0 +1,41 @@ + + + 订单信息 + + + 订单编号 + 454fdsf54f5d4f54sdf4d + + + 商品总价 + ¥999.00 + + + 运费 + -¥999.00 + + + 应付总价 + + ¥999.00 + + + + + 支付方式 + + + + + + 微信支付 + + + + + + + + + 立即支付 + \ No newline at end of file diff --git a/pages/mall/mall_pay/mall_pay.wxss b/pages/mall/mall_pay/mall_pay.wxss new file mode 100644 index 0000000..02c9d3b --- /dev/null +++ b/pages/mall/mall_pay/mall_pay.wxss @@ -0,0 +1,116 @@ +/* + * 手太欠 + * 企获客商城 + */ + +page { + background-color: #f7f7f7; +} + +.order-content { + border-bottom: solid 100rpx transparent; +} + +/* 订单支付 */ + +.order-title { + font-weight: 600; + padding: 30rpx; +} + +.order-total { + background: white; + margin-bottom: 30rpx; + border-top: 2rpx solid #eee; + border-bottom: 2rpx solid #eee; +} + +.order-total-number { + border-bottom: 2rpx solid #eee; + line-height: 54rpx; +} + +.order-total-li { + padding: 20rpx 30rpx; + display: flex; + position: relative; +} + +.order-total-name { + flex: 1; +} + +.order-total-li text { + color: #999; +} + +.coupon-picker-red { + color: #ea4e2f; +} + +.order-total-textarea { + width: 200rpx; + height: 80rpx; +} + + +.order-total-li textarea { + line-height: 50rpx; + height: 100rpx; +} + + +/* 支付类型 */ + +.payContList { + border-top: 2rpx solid #eee; + border-bottom: 2rpx solid #eee; + padding: 30rpx; + background: #fff; +} + +.payContList-label { + height: 60rpx; + line-height: 60rpx; + display: flex; +} + +.payContList-label-name { + flex: 1; + display: flex; +} + +.payContList-label-img { + width: 60rpx; + height: 60rpx; + margin-right: 20rpx; +} + + +/* 支付按钮 */ + +.address-footer{ + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding-left: 30rpx; + padding-right: 30rpx; + background: white; + border-top: 2rpx solid #eeeeee; + z-index: 9; + height: 130rpx; +} + +.address-footer text{ + display: block; + width: 100%; + line-height: 90rpx; + height: 90rpx; + margin: 20rpx 0; + text-align: center; + background: #eb532a; + font-size: 30rpx; + color: white; + border-radius: 60rpx; +} diff --git a/pages/mall/mall_search/mall_search.js b/pages/mall/mall_search/mall_search.js new file mode 100644 index 0000000..1672961 --- /dev/null +++ b/pages/mall/mall_search/mall_search.js @@ -0,0 +1,59 @@ +/** + * 手太欠 + * 5g获客星光网 - 商城 + */ + +Page({ + + /** + * 页面的初始数据 + */ + data: { + hotkey: [] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + // 获取热门关键字数据 + this.hotkeyInfo(); + }, + + /** + * 热门关键字 + */ + hotkeyInfo () { + wx.$api.mall.hotkey({}).then(res=>{ + console.log(res) + this.setData({ + hotkey : res + }) + }) + }, + + /** + * 搜索 + */ + searchForm(e) { + console.log(e.detail.value.search) + let searchValue = e.detail.value.search + wx.redirectTo({ + url: '/pages/mall_goods/mall_goods?title=' + searchValue + }) + }, + + /** + * 返回上一页 + */ + goback(){ + wx.navigateBack() + } +}) \ No newline at end of file diff --git a/pages/mall/mall_search/mall_search.json b/pages/mall/mall_search/mall_search.json new file mode 100644 index 0000000..5298e09 --- /dev/null +++ b/pages/mall/mall_search/mall_search.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "商品搜索" +} \ No newline at end of file diff --git a/pages/mall/mall_search/mall_search.wxml b/pages/mall/mall_search/mall_search.wxml new file mode 100644 index 0000000..c4c91fb --- /dev/null +++ b/pages/mall/mall_search/mall_search.wxml @@ -0,0 +1,18 @@ + + + + + + + + + + 取消 +
+ + + 热门搜索 + + {{index}} + + \ No newline at end of file diff --git a/pages/mall/mall_search/mall_search.wxss b/pages/mall/mall_search/mall_search.wxss new file mode 100644 index 0000000..9c488e4 --- /dev/null +++ b/pages/mall/mall_search/mall_search.wxss @@ -0,0 +1,156 @@ + +/* + * 手太欠 + * 企获客商城模块 + */ + +/* 搜索 */ + +.search { + height: 100rpx; + position: fixed; + left: 0; + top: 0; + width: 100%; + z-index: 999; + padding: 20rpx; + box-sizing: border-box; + line-height: 80rpx; +} + +.search-inputs{ + border: #ea4e2f solid 2rpx; + position: absolute; + left: 20rpx; + top: 20rpx; + border-radius: 50rpx; + height: 80rpx; + line-height: 80rpx; + width: calc(100% - 150rpx); +} + +.search-input{ + height: 80rpx; + line-height: 80rpx; + width: calc(100% - 150rpx); + padding-left: 120rpx; + box-sizing: border-box; +} + +.search-icon{ + width: 48rpx; + height: 48rpx; + position: absolute; + top: 16rpx; + left: 30rpx; +} + +.search-btn[size="mini"]{ + font-size: 32rpx; + width: 150rpx; + text-align: center; + color: #3ec28e; + background: transparent; + position: absolute; + top: 0; + right: 0; + height: 80rpx; + line-height: 80rpx; + font-weight: bold; + padding: 0; +} + +.search-cancel { + position: absolute; + right: 20rpx; + top: 20rpx; + width: 90rpx; + text-align: right; + font-size: 34rpx; + color: #666666; +} + +/* 产品列表 */ +.link-products { + flex-wrap: wrap; + padding: 112rpx 15rpx 0 15rpx; +} + +.link-product { + background: white; + width: calc(50% - 20rpx); + box-sizing: border-box; + margin: 0 10rpx 20rpx 10rpx; + border-radius: 6rpx; + overflow: hidden; + display: inline-block; +} + +.link-product-img { + position: relative; + width: 100%; + padding-top: 100%; + background: #ddd; +} + +.link-product-img-src { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.link-product-text { + padding: 15rpx 20rpx; +} + +.link-product-picer { + position: relative; + height: 52rpx; + line-height: 52rpx; + padding-right: 72rpx; + color: #f85d6b; + font-weight: bold; + font-size: 32rpx; +} + +.link-product-card { + position: absolute; + right: 0; + top: 0; + background: #f85d6b; + width: 28rpx; + height: 28rpx; + padding: 12rpx; + border-radius: 50%; + z-index: 1; +} + +.link-product-title { + height: 50rpx; + line-height: 50rpx; + margin-bottom: 15rpx; +} + + +/* 热门搜索 */ +.hot-search { + flex-wrap: wrap; + padding: 140rpx 20rpx 20rpx; +} + +.hot-search-title { + margin-bottom: 20rpx; + font-weight: 600; +} + +.hot-search-list navigator { + display: inline-block; + background-color: #f7f7f7; + border-radius: 50rpx; + margin: 10rpx; + padding: 0 30rpx; + line-height: 58rpx; + font-size: 26rpx; +} \ No newline at end of file diff --git a/pages/mall/mall_video/mall_video.js b/pages/mall/mall_video/mall_video.js new file mode 100644 index 0000000..8929ac4 --- /dev/null +++ b/pages/mall/mall_video/mall_video.js @@ -0,0 +1,66 @@ +// pages/mall_video/mall_video.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/mall/mall_video/mall_video.json b/pages/mall/mall_video/mall_video.json new file mode 100644 index 0000000..67ea6cc --- /dev/null +++ b/pages/mall/mall_video/mall_video.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "商品直播" +} \ No newline at end of file diff --git a/pages/mall/mall_video/mall_video.wxml b/pages/mall/mall_video/mall_video.wxml new file mode 100644 index 0000000..c972959 --- /dev/null +++ b/pages/mall/mall_video/mall_video.wxml @@ -0,0 +1,47 @@ + + + + + + + + 正在直播 + + + + 风光雪月跨年季 + + + + 张慢慢呀 + + + + 开播时间:2020-12-22 19:00:00 + + + + + + + + + + 已结束 + + + + 风光雪月跨年季 + + + + 张慢慢呀 + + + + 开播时间:2020-12-22 19:00:00 + + + + + \ No newline at end of file diff --git a/pages/mall/mall_video/mall_video.wxss b/pages/mall/mall_video/mall_video.wxss new file mode 100644 index 0000000..b8bbf17 --- /dev/null +++ b/pages/mall/mall_video/mall_video.wxss @@ -0,0 +1,118 @@ +page { + background-color: #f7f7f7; +} + +/* 列表 */ +.videoList { + overflow: hidden; + margin: 20rpx; +} + +.videoList-label { + width: 100%; + background-color: #fff; + overflow: hidden; + margin-bottom: 20rpx; + box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); +} + +.videoList-img { + position: relative; + width: 100%; + padding-top: 80%; +} + +.videoList-img .videoList-cover { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.videoList-tips { + position: absolute; + top: 20rpx; + left: 20rpx; + font-size: 24rpx; +} + +.videoList-tips-img { + position: absolute; + top: 0; + left: 0; + background: #f2a861; + width: 58rpx; + height: 58rpx; + padding: 14rpx; + box-sizing: border-box; + border-radius: 8rpx; + overflow: hidden; +} + +.videoList-tips-text { + position: absolute; + left: 56rpx; + top: 5rpx; + height: 48rpx; + line-height: 48rpx; + background-image: linear-gradient(to right, #f5813d, #e9c140); + width: 110rpx; + color: #fff; + border-radius: 0 8rpx 8rpx 0; + opacity: .8; + text-align: center; +} + +.videoList-tips-end .videoList-tips-img { + background: #606564; +} + +.videoList-tips-end .videoList-tips-text { + background-image: linear-gradient(to right, #25292d, #847f7c); +} + +.videoList-tips image { + width: 100%; + height: 100%; +} + +.videoList-cont { + padding: 20rpx; + box-sizing: border-box; +} + +.videoList-title { + font-size: 34rpx; +} + +.videoList-user { + display: flex; + line-height: 50rpx; + font-size: 28rpx; + margin-top: 20rpx; + color: #999; +} + +.videoList-head { + flex: 1; + width: 150rpx; + display: flex; +} + +.videoList-head text { + display: inline-block; + width: calc(100% - 50rpx); +} + +.videoList-time { + width: calc(100% - 150rpx); + display: flex; +} + +.videoList-head image, +.videoList-time image { + width: 40rpx; + height: 40rpx; + margin-right: 10rpx; +} \ No newline at end of file diff --git a/pages/ticket/goods/goods.js b/pages/ticket/goods/goods.js new file mode 100644 index 0000000..dd4efa1 --- /dev/null +++ b/pages/ticket/goods/goods.js @@ -0,0 +1,121 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + user_coupon_id : '', //券id + title : '', //搜索关键字标题 + dataArr : [], + page : {}, //分页信息 + lodingStats : false, //加载状态 + ordertype : '', //排序类型 price为价格 sell为销量 + orderasc : '', //排序方式 asc为正序 desc为倒序 + total_page : '', + current : '', + nomore :false + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + user_coupon_id: options.user_coupon_id, + + }) + this.goosInfo() + }, + + goosInfo() { + if (wx.getStorageSync("token") == "") { + wx.navigateTo({ + url: '/pages/login/login' + }) + return + } + let orderasc = this.data.orderasc, + ordertype = this.data.ordertype + wx.$api.mall.couponsGoods({ + user_coupon_id : this.data.user_coupon_id, + title : this.data.title || '', + page : this.data.page || '', + orderasc : orderasc, + ordertype : ordertype, + }).then(res => { + this.setData({ + dataArr : res.data, + total_page: res.page.total_page, + current : res.page.current, + }) + + }) + }, + confirmTap(event) { + let searchvalue = event.detail.value + this.setData({ + title: searchvalue + }) + + // 拉取商品列表数据 + this.goosInfo(); + }, + /** + * 综合推荐 + */ + emptyTap() { + this.setData({ + orderasc : '', + ordertype : '' + }) + + // 拉取商品列表数据 + this.goosInfo(); + }, + /** + * 销量排序 + */ + orderTap(e) { + let type = e.currentTarget.dataset.type + this.setData({ + ordertype: type, + }) + if (this.data.orderasc == 'asc') { + this.setData({ + orderasc: 'desc', + }) + } else { + this.setData({ + orderasc: 'asc', + }) + } + + // 拉取商品列表数据 + this.goosInfo(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + let total_page = this.data.total_page; + let current = parseInt(this.data.current) + 1; + this.setData({ + page: current + }) + if (current > total_page) { + this.setData({ + nomore: true + }) + } else { + this.goosInfo(); + } + } + }) \ No newline at end of file diff --git a/pages/ticket/goods/goods.json b/pages/ticket/goods/goods.json new file mode 100644 index 0000000..e97a873 --- /dev/null +++ b/pages/ticket/goods/goods.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText": "商品" +} \ No newline at end of file diff --git a/pages/ticket/goods/goods.wxml b/pages/ticket/goods/goods.wxml new file mode 100644 index 0000000..39a93b4 --- /dev/null +++ b/pages/ticket/goods/goods.wxml @@ -0,0 +1,68 @@ + +
+ + + + + +
+ + + + 综合推荐 + + 销量 + + + + + + + + 价格 + + + + + + + + + + + + + + + + + {{item.title}} + + + + ¥{{item.prices.price}} + + + 协会: ¥{{item.prices.association}} + + + + + vip + ¥{{item.prices.vip}} + + 已售{{item.sell_number}} + + + + + + + + + + 暂无内容 + +没有更多了~ \ No newline at end of file diff --git a/pages/ticket/goods/goods.wxss b/pages/ticket/goods/goods.wxss new file mode 100644 index 0000000..4e31ef1 --- /dev/null +++ b/pages/ticket/goods/goods.wxss @@ -0,0 +1,165 @@ +/** + + * 优惠券可用商品 + */ + + page { + background-color: #f7f7f7; + } + + /* 商城搜索 */ + .mallSearch { + position: fixed; + width: 100%; + top: 0; + left: 0; + height: 120rpx; + box-sizing: border-box; + padding: 20rpx 30rpx; + background-color: #fff; + z-index: 9; + } + + .mallSearch-cont { + background-color: #f7f7f7; + border-radius: 100rpx; + padding: 18rpx 30rpx; + box-sizing: border-box; + display: flex; + color: #999999; + height: 80rpx; + width: 100%; + } + + .mallSearch-cont-icon { + width: 44rpx; + height: 44rpx; + margin-right: 30rpx; + } + + .mallSearch-cont input { + width: calc(100% - 44px); + } + + .mallTag { + position: fixed; + left: 0; + top: 110rpx; + width: 100%; + background-color: #fff; + padding: 40rpx; + box-sizing: border-box; + display: flex; + z-index: 9; + } + + .mallTag-one { + width: 200rpx; + } + + .mallTag-name { + display: flex; + width: 150rpx; + } + + .mallTag-name image { + width: 30rpx; + height: 30rpx; + margin: 7rpx 10rpx; + } + + .mallTag-name.active, + .mallTag-one.active { + color: #d32300; + } + + /* 商品 */ + + .recommend-list { + overflow: hidden; + margin: 260rpx 20rpx 30rpx; + } + + .recommend-label { + float: left; + width: calc(50% - 20rpx); + margin: 0 10rpx 20rpx; + border-radius: 10rpx; + overflow: hidden; + background-color: white ; + } + + .recommend-img { + position: relative; + width: 100%; + padding-top: 100%; + } + + .recommend-img image { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + } + + .recommend-cont { + padding: 20rpx; + box-sizing: border-box; + } + + .recommend-price { + margin: 20rpx 0; + display: flex; + font-size: 28rpx; + } + + .recommend-ruling { + color: #ea4e2f; + font-weight: 600; + } + + .recommend-ruling text { + font-size: 24rpx; + } + + .recommend-cost { + font-size: 24rpx; + color: #999; + margin: 2rpx 0 0 20rpx; + } + + .recommend-mark { + background-color: #f2e4c0; + border-radius: 6rpx; + display: inline-block; + font-size: 24rpx; + overflow: hidden; + height: 38rpx; + line-height: 38rpx; + padding-right: 10rpx; + } + + .recommend-vip { + display: inline-block; + line-height: 38rpx; + background-color: #333333; + color: #f2e4c0; + padding: 0 10rpx; + } + + .recommend-sell { + float: right; + font-size: 24rpx; + line-height: 38rpx; + color: #aaabab; + } + .nomore { + width: 100%; + height: 60rpx; + line-height: 60rpx; + text-align: center; + color: #999; + margin-bottom: 20rpx; + font-size: 28rpx; + } \ No newline at end of file diff --git a/pages/ticket/index.js b/pages/ticket/index.js index f0f0b00..020a5a8 100644 --- a/pages/ticket/index.js +++ b/pages/ticket/index.js @@ -1,25 +1,41 @@ -// pages/ticket/index.js +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() Page({ /** * 页面的初始数据 */ data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - + couponList : [], + couponMenu : [ + { + type: 'all', + text: '全部' + }, + { + type: 1, + text: '免费券' + }, + { + type: 2, + text: '代金券' + }, + { + type: 3, + text: '提货卡' + } + ], + currentTab : 0, + type :'', + total_page :'', + current :'', + page :'', + default :'', + nomore : false }, /** @@ -27,40 +43,85 @@ Page({ */ onShow: function () { + this.couponInfo(); }, + couponInfo() { - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { + wx.$api.mall.coupon({ + type: this.data.type || '', + page: this.data.page || '' + } ).then(res => { + console.log(res) + let newrcoupon = res.data; + this.setData({ + couponList: this.data.couponList.concat(newrcoupon), //优惠券数组 + total_page:res.page.total_page, + current:res.page.current, + }) + if(this.data.couponList.concat(newrcoupon).length==0){ + this.setData({ + default:true + }) + }else{ + this.setData({ + default:'' + }) + } + }) }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - + couponChange(e) { + let cur = e.target.dataset.current; + let type = e.target.dataset.type; + this.setData({ + currentTab: cur, + type:type, + page:'', + couponList:[], + nomore: false + }) + this.couponInfo(); }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - + receive(e) { + if (wx.getStorageSync("token") == "") { + wx.navigateTo({ + url: '/pages/login/login' + }) + return + } + console.log('e', e) + let coupon_id = e.target.dataset.id; + wx.$api.mall.grant({ + coupon_id: coupon_id + }).then(res => { + console.log(res) + wx.showToast({ + title: res, + icon : 'none' + }) + }) + }, + linkMy(){ + wx.navigateTo({ + url: '/pages/user_coupon/user_coupon' + }) }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - + let total_page = this.data.total_page; + let current = parseInt(this.data.current) + 1; + this.setData({ + page: current + }) + if(current > total_page){ + this.setData({ + nomore: true + }) + }else{ + this.couponInfo(); + } } }) \ No newline at end of file diff --git a/pages/ticket/index.json b/pages/ticket/index.json index 8835af0..46750b6 100644 --- a/pages/ticket/index.json +++ b/pages/ticket/index.json @@ -1,3 +1,4 @@ { - "usingComponents": {} + "usingComponents" : {}, + "navigationBarTitleText" : "优惠" } \ No newline at end of file diff --git a/pages/ticket/index.wxml b/pages/ticket/index.wxml index 82545bb..e754f52 100644 --- a/pages/ticket/index.wxml +++ b/pages/ticket/index.wxml @@ -1,2 +1,89 @@ - -pages/ticket/index.wxml + + + + + + + + 优惠券 + + 我的卡券 + + + + {{item.text}} + + + + + + 暂无优惠券 + + + + + + + {{item.type_text}} + + + + + + + + {{item.title}}{{item.whole}}{{item.way}} + + 立即领取 + + + + + + {{item.type_text}} + + + + {{item.price}} + + + {{item.title}}{{item.whole}}{{item.way}} + + 立即领取 + + + + + {{item.type_text}} + + + + + + + + {{item.title}}{{item.whole}}{{item.way}} + + 立即领取 + + + + 没有更多了~ + + + + + \ No newline at end of file diff --git a/pages/ticket/index.wxss b/pages/ticket/index.wxss index 2d42574..cae3d14 100644 --- a/pages/ticket/index.wxss +++ b/pages/ticket/index.wxss @@ -1 +1,302 @@ -/* pages/ticket/index.wxss */ \ No newline at end of file +/* + * 手太欠 + * 企获客商城 + */ + + .coupon { + margin: 0 20rpx; +} + +/* 轮播图 */ +.banner { + position: relative; + padding-top: 50%; + width: 100%; + background: white; + border-radius: 10rpx; + overflow: hidden; + margin: 30rpx 0; +} + +.banner-swiper { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.banner-img { + width: 100%; + height: 100%; + vertical-align: top; +} + +/* 优惠券列表 */ +.couponTitle { + display: flex; +} + +.couponTitle text { + flex: 1; + display: block; + font-weight: 600; +} + +.couponTitle-more { + display: flex; + color: #666666; +} + +.couponTitle-more image { + width: 30rpx; + height: 30rpx; + margin: 6rpx 0 0 10rpx; +} + +.couponLabel { + /* white-space: nowrap; */ + margin: 20rpx -15rpx; + display: flex; +} + +.couponLabel text { + display: inline-block; + flex: auto; + font-size: 28rpx; + background-color: #e6e8f0; + line-height: 60rpx; + padding: 0 30rpx; + border-radius: 40rpx; + width: 90rpx; + margin: 15rpx; + text-align: center; +} + +.couponLabel text.active { + background-color: #2151f5; + color: #fff; +} + +.couponEject-list-label { + position: relative; + width: 100%; + padding-top: 32%; + margin-bottom: 30rpx; +} + +.couponEject-list-label::after, +.couponEject-list-label::before { + position: absolute; + content: ''; + width: 30rpx; + height: 30rpx; + border-radius: 50%; + background-color: white; + z-index: 111; +} + +.couponEject-list-label::after { + top: -15rpx; + right: 160rpx; +} + +.couponEject-list-label::before { + bottom: -15rpx; + right: 160rpx; +} + +.couponEject-list-title { + margin-bottom: 30rpx; +} + +.couponEject-list-back { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + border-radius: 20rpx; +} + +.couponEject-list-tips { + position: absolute; + top: 0; + left: 0; + background-color: #c0d3fc; + color: #2151f5; + z-index: 102; + font-size: 26rpx; + border-radius: 10rpx 0 10rpx 0; + padding: 6rpx 20rpx; +} + +.couponEject-list-cont { + z-index: 102; + position: absolute; + top: calc(50% - 70rpx); + left: 0; + right: 0; + color: #fff; + display: flex; + height: 140rpx; +} + +.couponEject-list-left { + width: calc(100% - 200rpx); + display: flex; + margin-right: 40rpx; +} + +.couponEject-list-price { + position: relative; + width: 45%; + height: 140rpx; + +} + +.couponEject-list-price2 { + position: relative; + width: 45%; + height: 140rpx; + font-size: 50rpx; + text-align: center; + font-weight: 600; + line-height: 140rpx; +} + +.coupon-icon { + height: 120rpx; + margin-top: 10rpx; + margin-left: calc(50% - 60rpx); + width: 120rpx; +} + +.couponEject-list-price::after { + position: absolute; + content: ''; + right: 0; + top: 20%; + width: 2rpx; + height: 60%; + background-color: rgba(255, 255, 255, .5); +} + +.couponEject-list-price2::after { + position: absolute; + content: ''; + right: 0; + top: 20%; + width: 2rpx; + height: 60%; + background-color: rgba(255, 255, 255, .5); +} + +.couponEject-list-price text { + font-size: 28rpx; + font-weight: normal; +} + +.couponEject-list-name { + text-align: center; + width: 55%; +} + +.couponEject-list-name text { + font-size: 26rpx; + display: block; + margin-top: 10rpx; + opacity: .7; +} + +.couponEject-list-btn { + width: 140rpx; + color: #2d6bf6; + background-color: #fff; + border-radius: 50rpx; + text-align: center; + height: 56rpx; + line-height: 56rpx; + font-size: 28rpx; + box-shadow: 0 0 10rpx rgba(0, 50, 61, .2); + margin-top: 50rpx; +} + +.couponEject-list-line { + position: absolute; + width: 0; + height: 100%; + content: ''; + border: 2rpx dotted #fff; + right: 175rpx; + top: 0; + z-index: 102; +} + +.couponEject-list-blue { + height: 140rpx; + top: calc(50% - 70rpx); +} + +.couponEject-list-blue .couponEject-list-price { + line-height: 140rpx; +} + +.couponEject-list-blue .couponEject-list-price::after { + height: 60%; + top: 20%; +} + +.couponEject-list-blue .couponEject-list-btn { + margin-top: 50rpx; +} + + +.couponEject-list-tips-red { + background-color: #fac2cd; + color: #ae1635; +} + +.couponEject-list-red { + color: #f16d83; +} + +.couponEject-list-tips-yellow { + background-color: #fae5c2; + color: #bf7b06; +} + +.couponEject-list-yellow { + color: #b67c18; +} + +.price-tips { + font-size: 20rpx; +} + +.coupon-null { + width: 100%; + padding : 20% 0; + text-align: center; + +} + +.coupon-null image { + width: 300rpx; +} + +.coupon-text { + width: 100%; + text-align: center; + margin-top: 50rpx; + color: #666; +} +.nomore { + width: 100%; + height: 60rpx; + line-height: 60rpx; + text-align: center; + color: #999; + margin-bottom: 20rpx; + font-size: 28rpx; +} \ No newline at end of file diff --git a/pages/user/index.js b/pages/user/index.js index aa4d173..6547a73 100644 --- a/pages/user/index.js +++ b/pages/user/index.js @@ -1,4 +1,4 @@ -// pages/user/index.js +// pages/user/user.js Page({ /** diff --git a/pages/user/index.json b/pages/user/index.json index 8835af0..e6c9b1d 100644 --- a/pages/user/index.json +++ b/pages/user/index.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "usingComponents" : {}, + "navigationBarTitleText" : "个人中心", + "navigationBarBackgroundColor" : "#2e81fc", + "navigationBarTextStyle" : "white" } \ No newline at end of file diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 753ccb2..57b9b78 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -1,2 +1,112 @@ - -pages/user/index.wxml + + + + + 艾米家的傻钢^ + 游客 + + + + + + 89 + 钱包 + + + 5 + 关注 + + + 125 + 团队 + + + + + + 升级VIP会员 享会员特权 + + + + 立即开通 + + + + + + + + + + 我的卡券 + + + + + + 我的订单 + + + + + + 分享海报 + + + + + + 更多服务 + + + + + + + 活动参与 + + + + + + 项目预购 + + + + + 2 + + 我的购物车 + + + + + + 客服服务 + + + + + + 收货地址 + + + + + + 项目关注 + + + + + + 区块链证书 + + + + + + 设置 + + + \ No newline at end of file diff --git a/pages/user/index.wxss b/pages/user/index.wxss index ea787be..4ab7aba 100644 --- a/pages/user/index.wxss +++ b/pages/user/index.wxss @@ -1 +1,219 @@ -/* pages/user/index.wxss */ \ No newline at end of file +/* + * 手太欠 + * 企获客商城模块 + */ + +page { + background-color: #e9e9e9; +} + +/* 个人中心头部 */ +.userTop { + background-color: #2e81fc; + padding: 0 30rpx; + box-sizing: border-box; + color: #fff; +} + +.userTop-head { + display: flex; + padding: 30rpx; +} + +.userTop-name { + flex: 1; + font-size: 40rpx; + font-weight: 600; + margin-top: 20rpx; +} + +.userTop-name text { + font-size: 28rpx; + border: 2rpx #fff solid; + border-radius: 20rpx; + padding: 0 20rpx; + line-height: 40rpx; + display: inline-block; + margin-left: 10rpx; +} + +.userTop-img { + width: 120rpx; + height: 120rpx; + border-radius: 50%; +} + +.userTop-nav { + display: flex; +} + +.userTop-label { + flex: 3; + text-align: center; + font-size: 28rpx; +} + +.userTop-label text { + display: block; + font-size: 42rpx; +} + +.userTop-vip { + background-image: linear-gradient(to left, #1b2653, #354273); + border-radius: 20rpx 20rpx 0 0; + padding: 25rpx; + box-sizing: border-box; + margin-top: 30rpx; +} + +.userTop-vip, +.userTop-text, +.userTop-btn { + display: flex; +} + +.userTop-text { + flex: 1; + line-height: 60rpx; + font-size: 30rpx; +} + +.userTop-text image { + width: 54rpx; + height: 54rpx; + margin-right: 20rpx; +} + +.userTop-btn { + background-color: #fedd7c; + color: #313c6d; + border-radius: 50rpx; + height: 60rpx; + line-height: 60rpx; + padding-right: 20rpx; + font-size: 26rpx; +} + +.userTop-btn image { + width: 30rpx; + height: 30rpx; + margin: 15rpx 8rpx 15rpx 20rpx; +} + +.userNav { + padding: 30rpx 0; + box-sizing: border-box; + border-radius: 30rpx; + background-color: white; + overflow: hidden; + margin: 30rpx 20rpx; +} + +.userNav-label { + width: 33.33%; + float: left; + text-align: center; + font-weight: 600; + color: #353535; + font-size: 30rpx; +} + +.userNav-label-img { + width: 104rpx; + height: 104rpx; + border-radius: 40rpx; + margin: 0 auto 20rpx; + color: #fff; + padding: 25rpx; + box-sizing: border-box; +} + +.userNav-label:nth-child(1) .userNav-label-img { + background-image: linear-gradient(to top, #91d634, #75c470); +} + +.userNav-label:nth-child(2) .userNav-label-img { + background-image: linear-gradient(to top, #04d2c1, #3caff1); +} + +.userNav-label:nth-child(3) .userNav-label-img { + background-image: linear-gradient(to top, #ff686c, #ff0d76); +} + +.userNav-label image { + width: 100%; + height: 100%; + display: block; + +} + +/* 更多服务 */ +.userTool { + background-color: white; + border-radius: 20rpx; + margin: 0 20rpx; + padding: 30rpx 20rpx 0; + box-sizing: border-box; +} + +.userTool-title { + position: relative; + padding-left: 30rpx; + font-weight: 600; + margin-bottom: 30rpx; +} + +.userTool-title::after { + position: absolute; + content: ''; + background-color: #066aff; + left: 0; + top: 15%; + width: 8rpx; + height: 70%; + border-radius: 20rpx; +} + +.userTool-list { + overflow: hidden; + padding-top: 20rpx; + font-size: 30rpx; +} + +.userTool-label { + width: 25%; + float: left; + text-align: center; + margin-bottom: 50rpx; +} + +.userTool-label-img { + position: relative; + width: 94rpx; + height: 94rpx; + margin: 0 auto; + margin-bottom: 15rpx; +} + +.userTool-label-img image { + position: absolute; + left: 0; + top: 0; + height: 100%; + width: 100%; +} + +.userTool-label-tips { + position: absolute; + top: -5rpx; + right: -5rpx; + background-color: #ffffff; + border: 2rpx solid #ff106e; + color: #ff106e; + font-size: 24rpx; + border-radius: 50%; + width: 32rpx; + height: 32rpx; + line-height: 32rpx; + text-align: center; +} \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.js b/pages/user/user_coupon/user_coupon.js new file mode 100644 index 0000000..1387123 --- /dev/null +++ b/pages/user/user_coupon/user_coupon.js @@ -0,0 +1,164 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + stateType : 'ALL', //卡券分类 + couponList : [], + status : 1, + type : '', + statusTab : 0, + currentTab : 0, + statusMenu : [ + { + type: 1, + text: '未使用' + }, + { + type: 2, + text: '已使用' + }, + { + type: 3, + text: '已失效' + } + ], + couponMenu : [ + { + type: '', + text: '全部' + }, + { + type: 1, + text: '免费券' + }, + { + type: 2, + text: '代金券' + }, + { + type: 3, + text: '提货卡' + } + ], + coupontype : '', + couponstatus: '1', + total_page :'', + current :'', + page :'', + default :'', + nomore :false + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + this.couponInfo() + }, + + couponInfo() { + if (wx.getStorageSync("token") == "") { + wx.navigateTo({ + url: '/pages/login/login' + }) + return + } + wx.$api.mall.coupons({ + type : this.data.coupontype || '', + status : this.data.couponstatus || '', + page : this.data.page || '' + }).then(res => { + let newrcoupon = res.data; + this.setData({ + couponList: this.data.couponList.concat(newrcoupon), //优惠券数组 + total_page:res.page.total_page, + current:res.page.current, + }) + if(this.data.couponList.concat(newrcoupon).length==0){ + this.setData({ + default:true + }) + }else{ + this.setData({ + default:'' + }) + } + }) + }, + statusChange(e) { + let cur = e.target.dataset.current; + let couponstatus = e.target.dataset.type; + this.setData({ + statusTab : cur, + couponstatus:couponstatus, + coupontype :'', + page :'', + couponList :[], + currentTab :0, + nomore :false + }) + this.couponInfo() + }, + + couponChange(e){ + let cur = e.target.dataset.current; + let type = e.target.dataset.type; + this.setData({ + currentTab : cur, + coupontype :type, + page :'', + couponList :[], + nomore :false + }) + this.couponInfo(); + }, + detailLink(e){ + let verification = e.target.dataset.verification; + let itemtype = e.target.dataset.itemtype; + let couponid = e.target.dataset.couponid; + if(itemtype==1){ + var type='free' + }else if(itemtype==2){ + var type='cash' + }else if(itemtype==3){ + var type='rebate' + } + if(verification==2){ + wx.navigateTo({ + url: '/pages/user_coupon_data/user_coupon_data?user_coupon_id='+couponid+'&type='+type + }) + }else if(verification==1){ + wx.navigateTo({ + url: '/pages/coupon_goods/coupon_goods?user_coupon_id='+couponid + }) + } + + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + let total_page = this.data.total_page; + let current = parseInt(this.data.current) + 1; + this.setData({ + page: current + }) + if(current > total_page){ + this.setData({ + nomore: true + }) + }else{ + this.couponInfo(); + } + } +}) \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.json b/pages/user/user_coupon/user_coupon.json new file mode 100644 index 0000000..67031a0 --- /dev/null +++ b/pages/user/user_coupon/user_coupon.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "我的卡券" +} \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.wxml b/pages/user/user_coupon/user_coupon.wxml new file mode 100644 index 0000000..cb636c3 --- /dev/null +++ b/pages/user/user_coupon/user_coupon.wxml @@ -0,0 +1,107 @@ + + + {{item.text}} + + + + + + {{item.text}} + + + + + + + 暂无优惠券 + + + + + + 免费劵 + + + + + + {{item.title}}{{item.whole}}{{item.way}} + + 去使用 + 查看券码 + + + 已使用 + + + 已失效 + + {{item.time}} + + + + + + 代金券 + + {{item.price}} + + + + {{item.title}}{{item.whole}}{{item.way}} + + 去使用 + 查看券码 + + + 已使用 + + + 已失效 + + {{item.time}} + + + + + + 提货卡 + + + + + + {{item.title}}{{item.whole}}{{item.way}} + + 去使用 + 查看券码 + + + + 已使用 + + + 已失效 + + {{item.time}} + + + + + 没有更多了~ + + \ No newline at end of file diff --git a/pages/user/user_coupon/user_coupon.wxss b/pages/user/user_coupon/user_coupon.wxss new file mode 100644 index 0000000..b473dc6 --- /dev/null +++ b/pages/user/user_coupon/user_coupon.wxss @@ -0,0 +1,270 @@ +page { + background-color: #f7f7f7; +} + +/* 卡券分类tab */ +.coupon-tab, +.couponCut { + position: fixed; + left: 0; + width: 100%; + display: flex; + z-index: 112; +} + +.coupon-tab { + top: 0; + height: 80rpx; + line-height: 80rpx; + background: white; +} + +.coupon-tab-item { + width: 33.33%; + text-align: center; + border-bottom: solid 2rpx #f7f7f7; + color: #464854; + background: white; + position: relative; + font-size: 30rpx; +} + +.coupon-tab-item:after { + position: absolute; + content: ''; + left: calc(50% - 30rpx); + bottom: 0; + background-color: transparent; + width: 60rpx; + height: 8rpx; + border-radius: 50rpx; + color: #666666; +} + +.coupon-tab-item.active { + color: #2151f5; + font-weight: 600; +} + +.coupon-tab-item.active:after { + background-color: #2151f5; +} + +/* 卡券类型 */ +.couponList { + margin: 220rpx 20rpx 0; +} + +.couponCut { + top: 80rpx; + height: 126rpx; + line-height: 66rpx; + padding: 30rpx 40rpx; + box-sizing: border-box; + margin-bottom: 30rpx; + background-color: #f7f7f7; +} + +.couponCut text { + flex: 4; + text-align: center; + background-color: white; + color: #666666; + margin: 0 20rpx; + border-radius: 50rpx; + font-size: 28rpx; +} + +.couponCut text.active { + background-color: #2151f5; + color: #fff; +} + +.couponDraw-list-label { + position: relative; + width: 100%; + padding-top: 32%; + border: 2rpx solid #eeeeee; + border-radius: 10rpx; + margin-bottom: 30rpx; +} + +.couponDraw-list-label::after, +.couponDraw-list-label::before { + position: absolute; + content: ''; + width: 30rpx; + height: 30rpx; + border-radius: 50%; + background-color: #f7f7f7; + z-index: 111; +} + +.couponEject-list-label::after { + top: -15rpx; + right: 160rpx; +} + +.couponEject-list-label::before { + bottom: -15rpx; + right: 160rpx; +} + + +.couponDraw-list-label::after { + top: -15rpx; + left: calc(40% - 15rpx); +} + +.couponDraw-list-label::before { + bottom: -15rpx; + left: calc(40% - 15rpx); +} + +.couponDraw-list-tips { + position: absolute; + top: 0; + left: 0; + z-index: 102; + font-size: 26rpx; + border-radius: 10rpx 0 10rpx 0; + padding: 6rpx 20rpx; + background-color: #fae5c2; + color: #9b6404; +} + +.couponDraw-list-price { + width: 40%; + background-color: #eea931; + color: #fff; + position: absolute; + height: 100%; + left: 0; + top: 0; + border-radius: 10rpx 0 0 10rpx; + text-align: center; +} + +.couponDraw-list-part { + position: absolute; + width: 100%; + height: 70rpx; + top: calc(50% - 35rpx); + z-index: 102; + text-align: center; + font-size: 50rpx; + font-weight: 600; +} + +.couponDraw-list-text { + position: absolute; + right: 0; + top: 0; + width: 60%; + padding: 10rpx 20rpx; + box-sizing: border-box; + background-color: #fff; + height: 100%; +} + +.couponDraw-list-name text { + color: #999; + display: block; + font-size: 26rpx; + margin: 10rpx 0 5rpx; +} + +.couponDraw-list-btn { + color: #b67c18; + border: 2rpx solid #b67c18; + border-radius: 50rpx; + display: inline-block; + font-size: 26rpx; + padding: 6rpx 20rpx; + position: absolute; + top: 90rpx; + right: 20rpx; + margin-bottom: 20rpx; + min-width: 110rpx; + text-align: center; +} + +.couponDraw-list-time { + font-size: 26rpx; + color: #999; + clear: both; + position: absolute; + bottom: 20rpx; +} + +.couponDraw-list-red .couponDraw-list-price { + background-color: #ee3158; +} + +.couponDraw-list-red .couponDraw-list-btn { + border-color: #ba062b; + color: #b80026; +} + +.couponDraw-list-red .couponDraw-list-tips { + background-color: #fac2cd; + color: #94001f; +} + + +.couponDraw-list-blue .couponDraw-list-price { + background-color: #2d6bf6; +} + +.couponDraw-list-blue .couponDraw-list-btn { + border-color: #0f4acf; + color: #003fcc; +} + +.couponDraw-list-blue .couponDraw-list-tips { + background-color: #c0d3fc; + color: #2151f5; +} + +.coupon-null { + width: 100%; + padding: 20% 0; + text-align: center; + +} + +.coupon-null image { + width: 300rpx; +} + +.coupon-text { + width: 100%; + text-align: center; + margin-top: 50rpx; + color: #666; +} + +.coupon-icon { + height: 120rpx; + margin-top: 60rpx; + width: 120rpx; +} + +.price-tips { + font-size: 20rpx; +} + +.loose { + border-color: #999 !important; + color: #999 !important; +} + +.nomore { + width: 100%; + height: 60rpx; + line-height: 60rpx; + text-align: center; + color: #999; + margin-bottom: 20rpx; + font-size: 28rpx; +} \ No newline at end of file diff --git a/pages/user/user_coupon_data/user_coupon_data.js b/pages/user/user_coupon_data/user_coupon_data.js new file mode 100644 index 0000000..8ffa09a --- /dev/null +++ b/pages/user/user_coupon_data/user_coupon_data.js @@ -0,0 +1,62 @@ +/* + * 手太欠 + * 企获客商城 + */ + +const app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + type : '', //cash为代金券; rebate为折扣券; free为免费券 + user_coupon_id :'',//券id + title :'',//券标题 + price :'',//券金额 + way :'',//券途径 + code_url :'',//券二维码 + code :'',//券码编号 + type_text :'',//券类型 + start_at :'',//开始时间 + startend_at :'',//结束时间 + address :'',//核销地址 + phone :'',//客服电话 + name :'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad (options) { + this.setData({ + type : options.type, + user_coupon_id : options.user_coupon_id + }) + this.couponDetails() + }, + couponDetails(){ + wx.$api.mall.couponDetails(this.data.user_coupon_id).then(res => { + this.setData({ + title : res.title, + price : res.price, + way : res.way, + code_url : res.code_url, + code : res.code, + type_text : res.type_text, + start_at : res.start_at, + end_at : res.end_at, + rule : res.rule, + address :res.company.address, + phone :res.company.phone, + name :res.company.name, + }) + + }) + }, + makeCall(){ + wx.makePhoneCall({ + phoneNumber: this.data.phone + }) + } +}) \ No newline at end of file diff --git a/pages/user/user_coupon_data/user_coupon_data.json b/pages/user/user_coupon_data/user_coupon_data.json new file mode 100644 index 0000000..78e495c --- /dev/null +++ b/pages/user/user_coupon_data/user_coupon_data.json @@ -0,0 +1,4 @@ +{ + "usingComponents" : {}, + "navigationBarTitleText" : "我的卡券-查看券码" +} \ No newline at end of file diff --git a/pages/user/user_coupon_data/user_coupon_data.wxml b/pages/user/user_coupon_data/user_coupon_data.wxml new file mode 100644 index 0000000..facf337 --- /dev/null +++ b/pages/user/user_coupon_data/user_coupon_data.wxml @@ -0,0 +1,61 @@ + + + + + + + + + {{title}} + + + 金额 + {{price}} + + + 类型 + {{type_text}} + + + 渠道 + {{way}} + + + + 券码信息 + + {{code}} + + + + + + + + {{name}} + + + + {{address}} + + + + + 联系客服 + + + + + 使用说明 + + + 有效期: + {{start_at}}至{{end_at}} + + + 使用规格则: + {{rule}} + + + + \ No newline at end of file diff --git a/pages/user/user_coupon_data/user_coupon_data.wxss b/pages/user/user_coupon_data/user_coupon_data.wxss new file mode 100644 index 0000000..8860ecc --- /dev/null +++ b/pages/user/user_coupon_data/user_coupon_data.wxss @@ -0,0 +1,145 @@ +page { + background: #f7f7f7; +} + +/* 券码 */ +.couponData-top { + position: relative; + padding-top: 40%; + width: 100%; +} + +.couponData-top-img { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} + +.couponData-cont { + position: relative; + margin: -60rpx 30rpx 20rpx; +} + +.couponCode { + background-color: #fff; + border-radius: 20rpx; + box-shadow: 0 0 20rpx rgba(0, 0, 0, .1); + margin-bottom: 30rpx; +} + +.couponCode-title { + padding: 20rpx 20rpx 0; + font-weight: 600; + font-size: 36rpx; +} + +.couponCode-list { + padding: 20rpx; + box-sizing: border-box; + margin: 30rpx 0; +} + +.couponCode-list-label { + display: flex; + line-height: 60rpx; + +} + +.couponCode-list-name { + flex: 1; +} + +.couponCode-list-label text { + color: #666; +} + +.couponCode-list-price { + color: #d9263a !important; + font-size: 36rpx; +} + +.couponCode-info, +.couponCompany-tel { + border-top: 2rpx #dddddd dotted; + padding: 20rpx; + box-sizing: border-box; + text-align: center; +} + +.couponCode-info-title { + margin-bottom: 20rpx; + font-weight: 600; + text-align: left; +} + +.couponCode-info-img { + width: 260rpx; + height: 260rpx; + margin: 0 auto 20rpx; +} + +.couponCode-info-number { + color: #666666; + font-style: 28rpx; +} + +/* 公司简介 */ +.couponCompany-list { + padding: 20rpx; + box-sizing: border-box; +} + +.couponCompany-list-label { + line-height: 64rpx; + display: flex; + color: #666666; +} + +.couponCompany-list-label image { + width: 34rpx; + height: 34rpx; + margin: 15rpx 20rpx 10rpx 0; +} + +.couponCompany-list-label text { + color: #000; +} + +.couponCompany-tel { + line-height: 50rpx; +} + +.couponCompany-tel image { + width: 34rpx; + height: 34rpx; + margin-right: 20rpx; + vertical-align: -4rpx; +} + +.couponCompany-tel text { + display: inline-block; + line-height: 34rpx; +} + + +/* 使用说明 */ +.couponExplain { + padding: 20rpx; + box-sizing: border-box; +} + +.couponExplain-info-title { + font-weight: 600; + margin-bottom: 30rpx; +} + +.couponExplain-list-label { + color: #666666; + line-height: 60rpx; +} + +.couponExplain-list-label text { + color: #000; +} \ No newline at end of file diff --git a/static/images/car_icon.png b/static/images/car_icon.png new file mode 100644 index 0000000..1b1994d Binary files /dev/null and b/static/images/car_icon.png differ diff --git a/static/images/goods_text.png b/static/images/goods_text.png new file mode 100644 index 0000000..ce8de8c Binary files /dev/null and b/static/images/goods_text.png differ diff --git a/static/mall_icon/adddefault-bg.png b/static/mall_icon/adddefault-bg.png new file mode 100644 index 0000000..04f959c Binary files /dev/null and b/static/mall_icon/adddefault-bg.png differ diff --git a/static/mall_icon/address_back.png b/static/mall_icon/address_back.png new file mode 100644 index 0000000..9f10b85 Binary files /dev/null and b/static/mall_icon/address_back.png differ diff --git a/static/mall_icon/bag_more_icon.png b/static/mall_icon/bag_more_icon.png new file mode 100644 index 0000000..6cf7224 Binary files /dev/null and b/static/mall_icon/bag_more_icon.png differ diff --git a/static/mall_icon/close_icon.png b/static/mall_icon/close_icon.png new file mode 100644 index 0000000..77fa891 Binary files /dev/null and b/static/mall_icon/close_icon.png differ diff --git a/static/mall_icon/coupon-null00.png b/static/mall_icon/coupon-null00.png new file mode 100644 index 0000000..ec7540c Binary files /dev/null and b/static/mall_icon/coupon-null00.png differ diff --git a/static/mall_icon/goodsShare_icon.png b/static/mall_icon/goodsShare_icon.png new file mode 100644 index 0000000..19982a0 Binary files /dev/null and b/static/mall_icon/goodsShare_icon.png differ diff --git a/static/mall_icon/liveEnd_icon_white.png b/static/mall_icon/liveEnd_icon_white.png new file mode 100644 index 0000000..dfabe72 Binary files /dev/null and b/static/mall_icon/liveEnd_icon_white.png differ diff --git a/static/mall_icon/liveIng_bf.png b/static/mall_icon/liveIng_bf.png new file mode 100644 index 0000000..23f0a93 Binary files /dev/null and b/static/mall_icon/liveIng_bf.png differ diff --git a/static/mall_icon/liveIng_icon.png b/static/mall_icon/liveIng_icon.png new file mode 100644 index 0000000..e2c7b95 Binary files /dev/null and b/static/mall_icon/liveIng_icon.png differ diff --git a/static/mall_icon/liveIng_icon_white.png b/static/mall_icon/liveIng_icon_white.png new file mode 100644 index 0000000..6f0703e Binary files /dev/null and b/static/mall_icon/liveIng_icon_white.png differ diff --git a/static/mall_icon/liveIng_viedo.png b/static/mall_icon/liveIng_viedo.png new file mode 100644 index 0000000..b991285 Binary files /dev/null and b/static/mall_icon/liveIng_viedo.png differ diff --git a/static/mall_icon/mallAddress_00.png b/static/mall_icon/mallAddress_00.png new file mode 100644 index 0000000..ad90bf3 Binary files /dev/null and b/static/mall_icon/mallAddress_00.png differ diff --git a/static/mall_icon/mallAddress_01.png b/static/mall_icon/mallAddress_01.png new file mode 100644 index 0000000..abdc578 Binary files /dev/null and b/static/mall_icon/mallAddress_01.png differ diff --git a/static/mall_icon/mallAddress_02.png b/static/mall_icon/mallAddress_02.png new file mode 100644 index 0000000..7939505 Binary files /dev/null and b/static/mall_icon/mallAddress_02.png differ diff --git a/static/mall_icon/mallAddress_03.png b/static/mall_icon/mallAddress_03.png new file mode 100644 index 0000000..ca1a2ad Binary files /dev/null and b/static/mall_icon/mallAddress_03.png differ diff --git a/static/mall_icon/mallAddress_04.png b/static/mall_icon/mallAddress_04.png new file mode 100644 index 0000000..59b57e5 Binary files /dev/null and b/static/mall_icon/mallAddress_04.png differ diff --git a/static/mall_icon/mallAddress_del.png b/static/mall_icon/mallAddress_del.png new file mode 100644 index 0000000..4145e38 Binary files /dev/null and b/static/mall_icon/mallAddress_del.png differ diff --git a/static/mall_icon/mallAddress_modify.png b/static/mall_icon/mallAddress_modify.png new file mode 100644 index 0000000..3a02d3f Binary files /dev/null and b/static/mall_icon/mallAddress_modify.png differ diff --git a/static/mall_icon/mallCode.png b/static/mall_icon/mallCode.png new file mode 100644 index 0000000..648b5d0 Binary files /dev/null and b/static/mall_icon/mallCode.png differ diff --git a/static/mall_icon/mallCoupon_back.png b/static/mall_icon/mallCoupon_back.png new file mode 100644 index 0000000..758ff08 Binary files /dev/null and b/static/mall_icon/mallCoupon_back.png differ diff --git a/static/mall_icon/mallCoupon_back_red.png b/static/mall_icon/mallCoupon_back_red.png new file mode 100644 index 0000000..ec9e988 Binary files /dev/null and b/static/mall_icon/mallCoupon_back_red.png differ diff --git a/static/mall_icon/mallCoupon_back_yellow.png b/static/mall_icon/mallCoupon_back_yellow.png new file mode 100644 index 0000000..98ec74d Binary files /dev/null and b/static/mall_icon/mallCoupon_back_yellow.png differ diff --git a/static/mall_icon/mallCoupon_cash.png b/static/mall_icon/mallCoupon_cash.png new file mode 100644 index 0000000..4285b43 Binary files /dev/null and b/static/mall_icon/mallCoupon_cash.png differ diff --git a/static/mall_icon/mallCoupon_free.png b/static/mall_icon/mallCoupon_free.png new file mode 100644 index 0000000..139d9e1 Binary files /dev/null and b/static/mall_icon/mallCoupon_free.png differ diff --git a/static/mall_icon/mallCoupon_rebate.png b/static/mall_icon/mallCoupon_rebate.png new file mode 100644 index 0000000..98af186 Binary files /dev/null and b/static/mall_icon/mallCoupon_rebate.png differ diff --git a/static/mall_icon/mallCoupon_rebate2.png b/static/mall_icon/mallCoupon_rebate2.png new file mode 100644 index 0000000..b0e0421 Binary files /dev/null and b/static/mall_icon/mallCoupon_rebate2.png differ diff --git a/static/mall_icon/mallCoupon_rebate3.png b/static/mall_icon/mallCoupon_rebate3.png new file mode 100644 index 0000000..c50f6cc Binary files /dev/null and b/static/mall_icon/mallCoupon_rebate3.png differ diff --git a/static/mall_icon/mallData_00.png b/static/mall_icon/mallData_00.png new file mode 100644 index 0000000..fe31ac2 Binary files /dev/null and b/static/mall_icon/mallData_00.png differ diff --git a/static/mall_icon/mallData_01.png b/static/mall_icon/mallData_01.png new file mode 100644 index 0000000..c25fe8a Binary files /dev/null and b/static/mall_icon/mallData_01.png differ diff --git a/static/mall_icon/mallData_02.png b/static/mall_icon/mallData_02.png new file mode 100644 index 0000000..8c5063f Binary files /dev/null and b/static/mall_icon/mallData_02.png differ diff --git a/static/mall_icon/mallData_03.png b/static/mall_icon/mallData_03.png new file mode 100644 index 0000000..cf4e6d6 Binary files /dev/null and b/static/mall_icon/mallData_03.png differ diff --git a/static/mall_icon/mallDetails_car.png b/static/mall_icon/mallDetails_car.png new file mode 100644 index 0000000..a31d095 Binary files /dev/null and b/static/mall_icon/mallDetails_car.png differ diff --git a/static/mall_icon/mallDetails_company.png b/static/mall_icon/mallDetails_company.png new file mode 100644 index 0000000..ed29c5c Binary files /dev/null and b/static/mall_icon/mallDetails_company.png differ diff --git a/static/mall_icon/mallDetails_gold.png b/static/mall_icon/mallDetails_gold.png new file mode 100644 index 0000000..767ef48 Binary files /dev/null and b/static/mall_icon/mallDetails_gold.png differ diff --git a/static/mall_icon/mallDetails_member.png b/static/mall_icon/mallDetails_member.png new file mode 100644 index 0000000..59dca0c Binary files /dev/null and b/static/mall_icon/mallDetails_member.png differ diff --git a/static/mall_icon/mallDetails_member_grey.png b/static/mall_icon/mallDetails_member_grey.png new file mode 100644 index 0000000..08a76ef Binary files /dev/null and b/static/mall_icon/mallDetails_member_grey.png differ diff --git a/static/mall_icon/mallDetails_service.png b/static/mall_icon/mallDetails_service.png new file mode 100644 index 0000000..ce35427 Binary files /dev/null and b/static/mall_icon/mallDetails_service.png differ diff --git a/static/mall_icon/mallDetails_user.png b/static/mall_icon/mallDetails_user.png new file mode 100644 index 0000000..4dfe748 Binary files /dev/null and b/static/mall_icon/mallDetails_user.png differ diff --git a/static/mall_icon/mallFloor.png b/static/mall_icon/mallFloor.png new file mode 100644 index 0000000..d60a66c Binary files /dev/null and b/static/mall_icon/mallFloor.png differ diff --git a/static/mall_icon/mallIndex_more.png b/static/mall_icon/mallIndex_more.png new file mode 100644 index 0000000..2c56925 Binary files /dev/null and b/static/mall_icon/mallIndex_more.png differ diff --git a/static/mall_icon/mallLocation.png b/static/mall_icon/mallLocation.png new file mode 100644 index 0000000..d7d2acc Binary files /dev/null and b/static/mall_icon/mallLocation.png differ diff --git a/static/mall_icon/mallNav_07.png b/static/mall_icon/mallNav_07.png new file mode 100644 index 0000000..0ea2fa6 Binary files /dev/null and b/static/mall_icon/mallNav_07.png differ diff --git a/static/mall_icon/mallStar.png b/static/mall_icon/mallStar.png new file mode 100644 index 0000000..4674f62 Binary files /dev/null and b/static/mall_icon/mallStar.png differ diff --git a/static/mall_icon/mallStar_avtive.png b/static/mall_icon/mallStar_avtive.png new file mode 100644 index 0000000..b25dcad Binary files /dev/null and b/static/mall_icon/mallStar_avtive.png differ diff --git a/static/mall_icon/mallTel.png b/static/mall_icon/mallTel.png new file mode 100644 index 0000000..2f98048 Binary files /dev/null and b/static/mall_icon/mallTel.png differ diff --git a/static/mall_icon/mall_arrow.png b/static/mall_icon/mall_arrow.png new file mode 100644 index 0000000..5258156 Binary files /dev/null and b/static/mall_icon/mall_arrow.png differ diff --git a/static/mall_icon/mall_close.png b/static/mall_icon/mall_close.png new file mode 100644 index 0000000..97ebf07 Binary files /dev/null and b/static/mall_icon/mall_close.png differ diff --git a/static/mall_icon/mall_search.png b/static/mall_icon/mall_search.png new file mode 100644 index 0000000..5ed65f2 Binary files /dev/null and b/static/mall_icon/mall_search.png differ diff --git a/static/mall_icon/null_icon.png b/static/mall_icon/null_icon.png new file mode 100644 index 0000000..303912f Binary files /dev/null and b/static/mall_icon/null_icon.png differ diff --git a/static/mall_icon/pay_00.png b/static/mall_icon/pay_00.png new file mode 100644 index 0000000..6030c26 Binary files /dev/null and b/static/mall_icon/pay_00.png differ diff --git a/static/mall_icon/price_icon.png b/static/mall_icon/price_icon.png new file mode 100644 index 0000000..393348f Binary files /dev/null and b/static/mall_icon/price_icon.png differ diff --git a/static/mall_icon/price_icon_active.png b/static/mall_icon/price_icon_active.png new file mode 100644 index 0000000..7e893a7 Binary files /dev/null and b/static/mall_icon/price_icon_active.png differ diff --git a/static/mall_icon/select.png b/static/mall_icon/select.png new file mode 100644 index 0000000..87df01f Binary files /dev/null and b/static/mall_icon/select.png differ diff --git a/static/mall_icon/select_avtive.png b/static/mall_icon/select_avtive.png new file mode 100644 index 0000000..35143b2 Binary files /dev/null and b/static/mall_icon/select_avtive.png differ diff --git a/static/mall_icon/share_pyq.png b/static/mall_icon/share_pyq.png new file mode 100644 index 0000000..eb02cbd Binary files /dev/null and b/static/mall_icon/share_pyq.png differ diff --git a/static/mall_icon/share_wx.png b/static/mall_icon/share_wx.png new file mode 100644 index 0000000..1d2772b Binary files /dev/null and b/static/mall_icon/share_wx.png differ diff --git a/static/user_iocn/userNav_00.png b/static/user_iocn/userNav_00.png new file mode 100644 index 0000000..cac57b2 Binary files /dev/null and b/static/user_iocn/userNav_00.png differ diff --git a/static/user_iocn/userNav_01.png b/static/user_iocn/userNav_01.png new file mode 100644 index 0000000..10daa89 Binary files /dev/null and b/static/user_iocn/userNav_01.png differ diff --git a/static/user_iocn/userNav_02.png b/static/user_iocn/userNav_02.png new file mode 100644 index 0000000..0259ebd Binary files /dev/null and b/static/user_iocn/userNav_02.png differ diff --git a/static/user_iocn/userTool_00.png b/static/user_iocn/userTool_00.png new file mode 100644 index 0000000..2f8e455 Binary files /dev/null and b/static/user_iocn/userTool_00.png differ diff --git a/static/user_iocn/userTool_01.png b/static/user_iocn/userTool_01.png new file mode 100644 index 0000000..d807312 Binary files /dev/null and b/static/user_iocn/userTool_01.png differ diff --git a/static/user_iocn/userTool_02.png b/static/user_iocn/userTool_02.png new file mode 100644 index 0000000..791a31d Binary files /dev/null and b/static/user_iocn/userTool_02.png differ diff --git a/static/user_iocn/userTool_03.png b/static/user_iocn/userTool_03.png new file mode 100644 index 0000000..462424b Binary files /dev/null and b/static/user_iocn/userTool_03.png differ diff --git a/static/user_iocn/userTool_04.png b/static/user_iocn/userTool_04.png new file mode 100644 index 0000000..fa18239 Binary files /dev/null and b/static/user_iocn/userTool_04.png differ diff --git a/static/user_iocn/userTool_05.png b/static/user_iocn/userTool_05.png new file mode 100644 index 0000000..51c6454 Binary files /dev/null and b/static/user_iocn/userTool_05.png differ diff --git a/static/user_iocn/userTool_06.png b/static/user_iocn/userTool_06.png new file mode 100644 index 0000000..f48adeb Binary files /dev/null and b/static/user_iocn/userTool_06.png differ diff --git a/static/user_iocn/userTool_07.png b/static/user_iocn/userTool_07.png new file mode 100644 index 0000000..51f02f4 Binary files /dev/null and b/static/user_iocn/userTool_07.png differ diff --git a/static/user_iocn/user_crown.png b/static/user_iocn/user_crown.png new file mode 100644 index 0000000..eb0d794 Binary files /dev/null and b/static/user_iocn/user_crown.png differ diff --git a/static/user_iocn/user_vip.png b/static/user_iocn/user_vip.png new file mode 100644 index 0000000..6f81278 Binary files /dev/null and b/static/user_iocn/user_vip.png differ