├── .idea
├── .name
├── watcherTasks.xml
├── encodings.xml
├── vcs.xml
├── jsLibraryMappings.xml
├── modules.xml
├── jingdong-app.iml
└── misc.xml
├── test
├── SetClearHistory
├── GetCurCoupon
├── GetChangeHotSearch
├── GetOrderNum
├── GetSearch
├── GetGoodsComments
├── GetCartInfo
├── GetGoodsDetail
├── GetMyOrder
├── GetSeckillProducts
├── GetCoupon
├── GetOrderDetail
├── getReceivedCoupon
├── GetSearchRulesBySale
├── GetSearchRulesByComprehensive
├── GetSearchResult
├── GetPriceByLowToHigh
├── GetCouponGoods
└── GetClassification
├── images
├── buycar
│ ├── 2.jpg
│ ├── mask.jpg
│ ├── goods_1.jpg
│ └── JDshopTitle.png
├── tabbar
│ ├── me.png
│ ├── home.png
│ ├── buycar.png
│ ├── me_sel.png
│ ├── buycar_sel.png
│ └── home_sel.png
├── index
│ ├── geted.png
│ ├── logo01.png
│ ├── scale.png
│ ├── not_get.png
│ ├── cheap_card.png
│ ├── class_goods.png
│ ├── filter_icon.png
│ ├── logistics.png
│ ├── product01.png
│ ├── product02.png
│ ├── product03.png
│ ├── product04.png
│ ├── product05.png
│ ├── scan_code.png
│ ├── goods_item01.png
│ ├── result_image01.png
│ ├── result_image02.png
│ └── result_image03.png
├── goods_detail
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ ├── 5.jpg
│ ├── 6.jpg
│ ├── comment.jpg
│ ├── comment_1.jpg
│ ├── comment_2.jpg
│ ├── comment_3.jpg
│ ├── comment_4.jpg
│ ├── duorou_1.jpg
│ ├── duorou_2.jpg
│ ├── duorou_3.jpg
│ ├── duorou_4.jpg
│ ├── shop-logo.png
│ ├── comment-star.png
│ └── product-detail-sprites-mjs.png
├── user_info
│ ├── img.png
│ ├── coupon_03.png
│ ├── goods_03.png
│ ├── goods_05.png
│ ├── goods_07.png
│ ├── all_orders.png
│ ├── not_paided.png
│ ├── not_received.png
│ ├── paid_order.png
│ ├── discound_card.png
│ └── left_grey_array.png
└── design_sketch
│ ├── me.jpg
│ ├── buy_car.jpg
│ ├── homepage.jpg
│ ├── jd_cards.jpg
│ ├── mine
│ ├── 67053911.jpg
│ ├── 1159124990.jpg
│ ├── 1540574707.jpg
│ ├── 1567708852.jpg
│ ├── 1743831902.jpg
│ ├── 1848627129.jpg
│ ├── 193889179.jpg
│ ├── 2111976560.jpg
│ ├── 337736874.jpg
│ ├── 356179483.jpg
│ ├── 361581526.jpg
│ ├── 609752791.jpg
│ ├── 610120412.jpg
│ ├── 643595092.jpg
│ ├── 688734591.jpg
│ ├── 819311973.jpg
│ ├── 882339369.jpg
│ └── 982685758.jpg
│ ├── buycar
│ ├── 1073898680.jpg
│ ├── 1450683879.jpg
│ ├── 1460395599.jpg
│ ├── 1490859416.jpg
│ ├── 1730732358.jpg
│ ├── 1926727157.jpg
│ ├── 1941060794.jpg
│ ├── 1958107939.jpg
│ ├── 2088491529.jpg
│ ├── 256508576.jpg
│ ├── 480129630.jpg
│ ├── 521150437.jpg
│ ├── 630059077.jpg
│ ├── 693278428.jpg
│ ├── 717513056.jpg
│ ├── 746078570.jpg
│ ├── 751112975.jpg
│ └── 771730517.jpg
│ ├── homePage
│ ├── 175048315.jpg
│ ├── 294172655.jpg
│ ├── 308006008.jpg
│ ├── 324746602.jpg
│ ├── 377867749.jpg
│ ├── 472624741.jpg
│ ├── 589570783.jpg
│ ├── 598873569.jpg
│ ├── 639447089.jpg
│ ├── 822269316.jpg
│ ├── 863070141.jpg
│ ├── 1005525376.jpg
│ ├── 1107559277.jpg
│ ├── 1193800466.jpg
│ ├── 1217233811.jpg
│ ├── 1261709050.jpg
│ ├── 1322625975.jpg
│ ├── 1345510021.jpg
│ ├── 1481605075.jpg
│ ├── 1486854428.jpg
│ ├── 1649156413.jpg
│ ├── 1716839206.jpg
│ ├── 1862837559.jpg
│ ├── 1896353383.jpg
│ ├── 1928732789.jpg
│ └── 2032427034.jpg
│ └── orders_management.jpg
├── pages
├── cart
│ ├── cart.json
│ ├── goods_detail
│ │ ├── goods_detail.json
│ │ ├── goods_detail.js
│ │ ├── goods_detail.wxml
│ │ └── goods_detail.wxss
│ ├── cart.wxml
│ ├── cart.wxss
│ └── cart.js
├── index
│ ├── index.json
│ ├── search
│ │ ├── search.json
│ │ ├── search.wxss
│ │ ├── search.wxml
│ │ └── search.js
│ ├── search_result
│ │ ├── search_result.json
│ │ ├── search_result.wxml
│ │ ├── search_result.js
│ │ └── search_result.wxss
│ ├── goods_classification
│ │ ├── goods_classification.json
│ │ ├── goods_classification.wxml
│ │ ├── goods_classification.js
│ │ └── goods_classification.wxss
│ ├── get_coupons
│ │ ├── get_coupons.json
│ │ ├── get_coupons.wxml
│ │ ├── get_coupons.wxss
│ │ └── get_coupons.js
│ ├── index.js
│ ├── index.wxss
│ └── index.wxml
└── user_info
│ ├── order_detail
│ ├── order_detail.json
│ ├── order_detail.js
│ ├── order_detail.wxml
│ └── order_detail.wxss
│ ├── user_info.json
│ ├── my_order
│ ├── my_order.json
│ ├── my_order.wxss
│ ├── my_order.js
│ └── my_order.wxml
│ ├── received_coupons
│ ├── received_coupons.json
│ ├── received_coupons.wxml
│ ├── received_coupons.js
│ └── received_coupons.wxss
│ ├── user_info.wxss
│ ├── user_info.js
│ └── user_info.wxml
├── css
├── common.wxss
└── common.less
├── app.wxss
├── app.js
├── app.json
├── README
└── utils
└── util.js
/.idea/.name:
--------------------------------------------------------------------------------
1 | jingdong-app
--------------------------------------------------------------------------------
/test/SetClearHistory:
--------------------------------------------------------------------------------
1 | {"result":"1"}
--------------------------------------------------------------------------------
/test/GetCurCoupon:
--------------------------------------------------------------------------------
1 | {
2 | "success":"1"
3 | }
--------------------------------------------------------------------------------
/images/buycar/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/buycar/2.jpg
--------------------------------------------------------------------------------
/images/tabbar/me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/tabbar/me.png
--------------------------------------------------------------------------------
/images/buycar/mask.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/buycar/mask.jpg
--------------------------------------------------------------------------------
/images/index/geted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/geted.png
--------------------------------------------------------------------------------
/images/index/logo01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/logo01.png
--------------------------------------------------------------------------------
/images/index/scale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/scale.png
--------------------------------------------------------------------------------
/images/tabbar/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/tabbar/home.png
--------------------------------------------------------------------------------
/images/buycar/goods_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/buycar/goods_1.jpg
--------------------------------------------------------------------------------
/images/goods_detail/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/1.jpg
--------------------------------------------------------------------------------
/images/goods_detail/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/2.jpg
--------------------------------------------------------------------------------
/images/goods_detail/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/3.jpg
--------------------------------------------------------------------------------
/images/goods_detail/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/4.jpg
--------------------------------------------------------------------------------
/images/goods_detail/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/5.jpg
--------------------------------------------------------------------------------
/images/goods_detail/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/6.jpg
--------------------------------------------------------------------------------
/images/index/not_get.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/not_get.png
--------------------------------------------------------------------------------
/images/tabbar/buycar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/tabbar/buycar.png
--------------------------------------------------------------------------------
/images/tabbar/me_sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/tabbar/me_sel.png
--------------------------------------------------------------------------------
/images/user_info/img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/img.png
--------------------------------------------------------------------------------
/images/design_sketch/me.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/me.jpg
--------------------------------------------------------------------------------
/images/index/cheap_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/cheap_card.png
--------------------------------------------------------------------------------
/images/index/class_goods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/class_goods.png
--------------------------------------------------------------------------------
/images/index/filter_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/filter_icon.png
--------------------------------------------------------------------------------
/images/index/logistics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/logistics.png
--------------------------------------------------------------------------------
/images/index/product01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/product01.png
--------------------------------------------------------------------------------
/images/index/product02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/product02.png
--------------------------------------------------------------------------------
/images/index/product03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/product03.png
--------------------------------------------------------------------------------
/images/index/product04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/product04.png
--------------------------------------------------------------------------------
/images/index/product05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/product05.png
--------------------------------------------------------------------------------
/images/index/scan_code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/scan_code.png
--------------------------------------------------------------------------------
/images/tabbar/buycar_sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/tabbar/buycar_sel.png
--------------------------------------------------------------------------------
/images/tabbar/home_sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/tabbar/home_sel.png
--------------------------------------------------------------------------------
/images/buycar/JDshopTitle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/buycar/JDshopTitle.png
--------------------------------------------------------------------------------
/images/index/goods_item01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/goods_item01.png
--------------------------------------------------------------------------------
/images/user_info/coupon_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/coupon_03.png
--------------------------------------------------------------------------------
/images/user_info/goods_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/goods_03.png
--------------------------------------------------------------------------------
/images/user_info/goods_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/goods_05.png
--------------------------------------------------------------------------------
/images/user_info/goods_07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/goods_07.png
--------------------------------------------------------------------------------
/test/GetChangeHotSearch:
--------------------------------------------------------------------------------
1 | {"hot_search":["哇哈哈","五粮液","小苹果","自行车","蛋糕","鲜花","魅族plus","鞋子","针织衫","戒指","玩具","自行车","秒杀","汽车用品"]}
--------------------------------------------------------------------------------
/images/design_sketch/buy_car.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buy_car.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homepage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homepage.jpg
--------------------------------------------------------------------------------
/images/design_sketch/jd_cards.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/jd_cards.jpg
--------------------------------------------------------------------------------
/images/goods_detail/comment.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/comment.jpg
--------------------------------------------------------------------------------
/images/goods_detail/comment_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/comment_1.jpg
--------------------------------------------------------------------------------
/images/goods_detail/comment_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/comment_2.jpg
--------------------------------------------------------------------------------
/images/goods_detail/comment_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/comment_3.jpg
--------------------------------------------------------------------------------
/images/goods_detail/comment_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/comment_4.jpg
--------------------------------------------------------------------------------
/images/goods_detail/duorou_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/duorou_1.jpg
--------------------------------------------------------------------------------
/images/goods_detail/duorou_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/duorou_2.jpg
--------------------------------------------------------------------------------
/images/goods_detail/duorou_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/duorou_3.jpg
--------------------------------------------------------------------------------
/images/goods_detail/duorou_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/duorou_4.jpg
--------------------------------------------------------------------------------
/images/goods_detail/shop-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/shop-logo.png
--------------------------------------------------------------------------------
/images/index/result_image01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/result_image01.png
--------------------------------------------------------------------------------
/images/index/result_image02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/result_image02.png
--------------------------------------------------------------------------------
/images/index/result_image03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/index/result_image03.png
--------------------------------------------------------------------------------
/images/user_info/all_orders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/all_orders.png
--------------------------------------------------------------------------------
/images/user_info/not_paided.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/not_paided.png
--------------------------------------------------------------------------------
/images/user_info/not_received.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/not_received.png
--------------------------------------------------------------------------------
/images/user_info/paid_order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/paid_order.png
--------------------------------------------------------------------------------
/images/user_info/discound_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/discound_card.png
--------------------------------------------------------------------------------
/test/GetOrderNum:
--------------------------------------------------------------------------------
1 | {
2 | "all_orders":"2",
3 | "unpaid_order":"1",
4 | "not_received_order":"",
5 | "discount_card":"5"
6 | }
--------------------------------------------------------------------------------
/images/design_sketch/mine/67053911.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/67053911.jpg
--------------------------------------------------------------------------------
/images/goods_detail/comment-star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/comment-star.png
--------------------------------------------------------------------------------
/images/user_info/left_grey_array.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/user_info/left_grey_array.png
--------------------------------------------------------------------------------
/images/design_sketch/mine/1159124990.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/1159124990.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/1540574707.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/1540574707.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/1567708852.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/1567708852.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/1743831902.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/1743831902.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/1848627129.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/1848627129.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/193889179.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/193889179.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/2111976560.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/2111976560.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/337736874.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/337736874.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/356179483.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/356179483.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/361581526.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/361581526.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/609752791.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/609752791.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/610120412.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/610120412.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/643595092.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/643595092.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/688734591.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/688734591.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/819311973.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/819311973.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/882339369.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/882339369.jpg
--------------------------------------------------------------------------------
/images/design_sketch/mine/982685758.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/mine/982685758.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1073898680.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1073898680.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1450683879.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1450683879.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1460395599.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1460395599.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1490859416.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1490859416.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1730732358.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1730732358.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1926727157.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1926727157.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1941060794.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1941060794.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/1958107939.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/1958107939.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/2088491529.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/2088491529.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/256508576.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/256508576.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/480129630.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/480129630.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/521150437.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/521150437.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/630059077.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/630059077.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/693278428.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/693278428.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/717513056.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/717513056.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/746078570.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/746078570.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/751112975.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/751112975.jpg
--------------------------------------------------------------------------------
/images/design_sketch/buycar/771730517.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/buycar/771730517.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/175048315.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/175048315.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/294172655.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/294172655.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/308006008.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/308006008.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/324746602.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/324746602.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/377867749.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/377867749.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/472624741.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/472624741.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/589570783.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/589570783.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/598873569.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/598873569.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/639447089.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/639447089.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/822269316.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/822269316.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/863070141.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/863070141.jpg
--------------------------------------------------------------------------------
/images/design_sketch/orders_management.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/orders_management.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1005525376.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1005525376.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1107559277.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1107559277.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1193800466.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1193800466.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1217233811.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1217233811.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1261709050.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1261709050.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1322625975.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1322625975.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1345510021.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1345510021.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1481605075.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1481605075.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1486854428.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1486854428.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1649156413.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1649156413.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1716839206.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1716839206.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1862837559.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1862837559.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1896353383.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1896353383.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/1928732789.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/1928732789.jpg
--------------------------------------------------------------------------------
/images/design_sketch/homePage/2032427034.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/design_sketch/homePage/2032427034.jpg
--------------------------------------------------------------------------------
/pages/cart/cart.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "white",
3 | "navigationBarTitleText": "购物车",
4 | "navigationBarTextStyle": "black"
5 | }
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "white",
3 | "navigationBarTitleText": "首页",
4 | "navigationBarTextStyle": "black"
5 | }
--------------------------------------------------------------------------------
/images/goods_detail/product-detail-sprites-mjs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skySoft-cloud/jingdong-app/HEAD/images/goods_detail/product-detail-sprites-mjs.png
--------------------------------------------------------------------------------
/test/GetSearch:
--------------------------------------------------------------------------------
1 | {"history_search":["唐老鸭","米老鼠","哆啦A梦","大熊"],
2 | "hot_search":["苹果手机","电动车","米老鼠","哆啦A梦","大熊","五粮液","魅族plus","毛巾","针织衫","书桌","巴隆","希曼","安迪","詹姆斯"]}
--------------------------------------------------------------------------------
/.idea/watcherTasks.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/pages/cart/goods_detail/goods_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#fff",
3 | "navigationBarTitleText": "商品详情",
4 | "navigationBarTextStyle": "black"
5 | }
--------------------------------------------------------------------------------
/pages/user_info/order_detail/order_detail.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "white",
3 | "navigationBarTitleText": "订单详情",
4 | "navigationBarTextStyle": "black"
5 | }
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/pages/index/search/search.json:
--------------------------------------------------------------------------------
1 | {
2 | "backgroundTextStyle": "black",
3 | "navigationBarBackgroundColor": " #fff",
4 | "navigationBarTitleText": "搜索",
5 | "navigationBarTextStyle": "black"
6 | }
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/pages/index/search_result/search_result.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#fff",
3 | "navigationBarTitleText": "搜索",
4 | "navigationBarTextStyle": "black",
5 | "backgroundTextStyle": "dark"
6 | }
--------------------------------------------------------------------------------
/pages/index/goods_classification/goods_classification.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#fff",
3 | "navigationBarTitleText": "商品分类",
4 | "navigationBarTextStyle": "black",
5 | "backgroundTextStyle": "dark"
6 | }
--------------------------------------------------------------------------------
/pages/user_info/user_info.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "white",
3 | "navigationBarTitleText": "我的",
4 | "navigationBarTextStyle": "black",
5 | "backgroundColor": "black",
6 | "backgroundTextStyle": "dark"
7 | }
--------------------------------------------------------------------------------
/.idea/jsLibraryMappings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/pages/user_info/my_order/my_order.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "white",
3 | "navigationBarTitleText": "我的订单",
4 | "navigationBarTextStyle": "black",
5 | "backgroundColor": "black",
6 | "backgroundTextStyle": "dark"
7 | }
--------------------------------------------------------------------------------
/pages/index/get_coupons/get_coupons.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "white",
3 | "navigationBarTitleText": "领优惠券",
4 | "navigationBarTextStyle": "black",
5 | "backgroundColor": "black",
6 | "backgroundTextStyle": "dark"
7 | }
--------------------------------------------------------------------------------
/pages/user_info/received_coupons/received_coupons.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "white",
3 | "navigationBarTitleText": "京东券",
4 | "navigationBarTextStyle": "black",
5 | "backgroundColor": "black",
6 | "backgroundTextStyle": "dark"
7 | }
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/jingdong-app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/css/common.wxss:
--------------------------------------------------------------------------------
1 | .base-flex {
2 | display: flex;
3 | flex-direction: column;
4 | justify-content: space-between;
5 | align-items: center;
6 | }
7 | .container {
8 | width: 100%;
9 | display: flex;
10 | flex-direction: column;
11 | justify-content: space-between;
12 | align-items: center;
13 | padding: 200rpx 0;
14 | box-sizing: border-box;
15 | }
16 |
--------------------------------------------------------------------------------
/test/GetGoodsComments:
--------------------------------------------------------------------------------
1 | {
2 | "goods_comments":[
3 | {
4 | "id": "1",
5 | "img_urls":[
6 | "../../../images/goods_detail/comment_1.jpg",
7 | "../../../images/goods_detail/comment_2.jpg",
8 | "../../../images/goods_detail/comment_3.jpg",
9 | "../../../images/goods_detail/comment_4.jpg"
10 | ],
11 | "username": "来东",
12 | "user_level": "PLUS会员",
13 | "user_comment": "货不错,包装的也很好,就是盆小了点,总体还满意",
14 | "date":"2017-09-11",
15 | "has_buy":"蒂亚"
16 | }
17 | ]
18 | }
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/css/common.less:
--------------------------------------------------------------------------------
1 | @full-height:100%;
2 | @base-padding:200rpx 0;
3 | @base-font-12: 24rpx !important;
4 | @base-font-16: 32rpx !important;
5 | @base-font-18: 36rpx !important;
6 | @base-font-24: 48rpx !important;
7 | @base-color-red:#f23030;
8 | @base-color-grey:#848689;
9 | @base-color-pink:#ff7878;
10 | @base-display:flex;
11 | @base-display-row:space-between;
12 | @base-display-column:center;
13 | @base-display-direction:column;
14 | @base-box-size:border-box;
15 |
16 | .base-flex{
17 | display: @base-display;
18 | flex-direction: @base-display-direction;
19 | justify-content: @base-display-row;
20 | align-items:@base-display-column;
21 | }
22 |
23 | .container{
24 | width: @full-height;
25 | .base-flex;
26 | padding: @base-padding;
27 | box-sizing:@base-box-size;
28 | }
--------------------------------------------------------------------------------
/test/GetCartInfo:
--------------------------------------------------------------------------------
1 | {
2 | "cart_info":[
3 | {
4 | "id": "1",
5 | "shop_name": "京东自营",
6 | "goods_img": "../../images/buycar/mask.jpg",
7 | "goods_describe": "【京东超市】Mediheal可莱丝美迪惠尔水润保湿面膜10片水库针剂(保湿补水男女士 护肤品)新老包装随机发放",
8 | "goods_spec": "重量:0.350kg;规格:水润保湿面膜10片",
9 | "default_num": "1",
10 | "goods_price": "128.00",
11 | "selected": true,
12 | "isTouchMove": false
13 | },
14 | {
15 | "id": "2",
16 | "shop_name": "连夏阁旗舰店",
17 | "goods_img": "../../images/buycar/2.jpg",
18 | "goods_describe": "连夏阁 大码休闲套装女2017夏季新款修身时尚裤腿短裤短袖雪纺衫两件套女装 荧光绿套装裤 XL",
19 | "goods_spec": "规格: 荧光绿套装裤, XL",
20 | "default_num": "1",
21 | "goods_price": "78.00",
22 | "selected": true,
23 | "isTouchMove": false
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/test/GetGoodsDetail:
--------------------------------------------------------------------------------
1 | {
2 | "goods_detail": {
3 | "id": "1",
4 | "big_img_urls":[
5 | "../../../images/goods_detail/duorou_1.jpg",
6 | "../../../images/goods_detail/duorou_2.jpg",
7 | "../../../images/goods_detail/duorou_3.jpg",
8 | "../../../images/goods_detail/duorou_4.jpg"
9 | ],
10 | "small_img_url": "../../../images/goods_detail/duorou_1.jpg",
11 | "shop_name": "京东自营",
12 | "shop_logo_url": "../../../images/goods_detail/shop-logo.png",
13 | "describe": "多肉 多肉植物 赠陶瓷盆赠土 多肉植物盆栽 24款新手入门 花卉植物 马库斯",
14 | "specification": "规格:马库斯",
15 | "is_selected": true,
16 | "is_touch_move": false,
17 | "new_price": "9.9",
18 | "old_price": "19.00",
19 | "count": "0",
20 | "type": ["马库斯","黑王子","姬胧月","黄丽","白牡丹","春萌","紫牡丹","吹雪之松锦","黄金草","乙女心","照波","观音莲","火祭","子持年华","玉珠莲","十二卷","霜之朝","晚霞之朝","苦娃娃","蒂亚"],
21 | "size": [],
22 | "default_type":"红色"
23 | }
24 | }
--------------------------------------------------------------------------------
/test/GetMyOrder:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "order_id": "001",
4 | "order_status": "0",
5 | "order_price": "334.00",
6 | "order_goods": [
7 | {
8 | "img_url": "../../../images/buycar/mask.jpg",
9 | "goods_quantity": "2",
10 | "goods_description": "【京东超市】Mediheal可莱丝美迪惠尔水润保湿面膜10片水库针剂(保湿补水男女士 护肤品)"
11 | },
12 | {
13 | "img_url": "../../../images/buycar/2.jpg",
14 | "goods_quantity": "1",
15 | "goods_description": "连夏阁 大码休闲套装女2017夏季新款修身时尚裤腿短裤短袖雪纺衫两件套女装 荧光绿套装裤 XL"
16 | }
17 | ]
18 | },
19 | {
20 | "order_id": "002",
21 | "order_status": "1",
22 | "order_price": "58.00",
23 | "order_goods": [
24 | {
25 | "img_url": "../../../images/index/goods_item01.png",
26 | "goods_quantity": "1",
27 | "goods_description": "【厂家直销】 【两件减8元】比达尼 2017夏装新款修身气"
28 | }
29 | ]
30 | }
31 | ]
--------------------------------------------------------------------------------
/test/GetSeckillProducts:
--------------------------------------------------------------------------------
1 | {
2 | "products_data": [
3 | {
4 | "id": "1",
5 | "description": "多肉 多肉植物 赠陶瓷盆赠土 多肉植物盆栽 24款新手入门 花卉植物 马库斯",
6 | "product_name": "比达尼 2017夏装新款修身气",
7 | "now_price": "9.90",
8 | "old_price": "19.00",
9 | "sold": "51%",
10 | "src": "../../images/goods_detail/duorou_1.jpg"
11 | },
12 | {
13 | "id": "_125801",
14 | "description": "【厂家直销】 【两件减8元】",
15 | "product_name": "比达尼 2017夏装新款修身气",
16 | "now_price": "58.00",
17 | "old_price": "139",
18 | "sold": "17%",
19 | "src": "../../images/index/goods_item01.png"
20 | },
21 | {
22 | "id": "_125802",
23 | "description": "【厂家直销】 【两件减8元】",
24 | "product_name": "比达尼 2017夏装新款修身气",
25 | "now_price": "58.00",
26 | "old_price": "139",
27 | "sold": "17%",
28 | "src": "../../images/index/goods_item01.png"
29 | }
30 | ]
31 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /*引入编写的共通样式*/
2 | @import "css/common.wxss";
3 | /**app.wxss**/
4 |
5 | /*全局共通样式均放在这里*/
6 |
7 | .container {
8 | height: 100%;
9 | display: flex;
10 | flex-direction: column;
11 | align-items: center;
12 | justify-content: space-between;
13 | padding: 200rpx 0;
14 | box-sizing: border-box;
15 | }
16 |
17 | /*页面基本样式
18 | * 背景色 #f0f2f5(灰色)
19 | * 字体:14px
20 | * 字体颜色:#232326(基本上是标题)其余是#848689(灰色字体)
21 | * 首页button等同色调使用color-pink,其余红色都使用color-red
22 | */
23 |
24 | page {
25 | background-color: #f0f2f5;
26 | font-family: PingFangSC-Regular, Helvetica, "Droid Sans", Arial, sans-serif;
27 | font-size: 28rpx;
28 | color: #232326;
29 | }
30 |
31 | .font-12 {
32 | font-size: 24rpx !important;
33 | }
34 |
35 | .font-16 {
36 | font-size: 32rpx !important;
37 | }
38 |
39 | .font-18 {
40 | font-size: 36rpx !important;
41 | }
42 |
43 | .font-24 {
44 | font-size: 48rpx !important;
45 | }
46 |
47 | .color-red {
48 | color: #f23030;
49 | }
50 |
51 | .color-grey {
52 | color: #848689;
53 | }
54 |
55 | .color-pink {
56 | color: #ff7878;
57 | }
58 |
59 | .fr{
60 | float: right;
61 | }
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | /******************************存放全局变量*********************************/
3 | App({
4 | /**
5 | * 获取用户信息,供各页面调用
6 | */
7 | getWechatInfo:function(callback){
8 | const that = this;
9 | // 1. 若全局userInfo存在,直接调用回调函数
10 | if(this.globalData.userInfo){
11 | typeof callback == "function" && callback(this.globalData.userInfo);
12 | }
13 | // 2. 若全局userInfo不存在,用wx.getUserInfo获取userInfo保存到全局
14 | else{
15 | //调用登录接口
16 | wx.login({
17 | success: function () {
18 | wx.getUserInfo({
19 | success: function (res) {
20 | that.globalData.userInfo = res.userInfo;
21 | typeof callback == "function" && callback(that.globalData.userInfo);
22 | }
23 | })
24 | }
25 | })
26 | }
27 | },
28 | globalData: {
29 | userInfo: null,
30 | // 和baron接口调试置为true用前者baseUrl;本地接口调试置为false,使用后者baseUrl
31 | baseUrl: false ? "http://10.8.6.107:8080/wx/" : "https://localhost:63342/jingdong-app/test/"
32 | }
33 | });
34 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/index/search/search",
5 | "pages/index/search_result/search_result",
6 | "pages/index/goods_classification/goods_classification",
7 | "pages/index/get_coupons/get_coupons",
8 | "pages/cart/cart",
9 | "pages/cart/goods_detail/goods_detail",
10 | "pages/user_info/user_info",
11 | "pages/user_info/my_order/my_order",
12 | "pages/user_info/order_detail/order_detail",
13 | "pages/user_info/received_coupons/received_coupons"
14 | ],
15 | "window": {
16 | "backgroundTextStyle": "light",
17 | "navigationBarBackgroundColor": " #c81624",
18 | "navigationBarTitleText": "京东购物",
19 | "navigationBarTextColor": "#fff"
20 | },
21 | "tabBar": {
22 | "selectedColor": "red",
23 | "borderStyle": "black",
24 | "list": [
25 | {
26 | "pagePath": "pages/index/index",
27 | "text": "首页",
28 | "iconPath": "images/tabbar/home.png",
29 | "selectedIconPath": "images/tabbar/home_sel.png"
30 | },
31 | {
32 | "pagePath": "pages/cart/cart",
33 | "text": "购物车",
34 | "iconPath": "images/tabbar/buycar.png",
35 | "selectedIconPath": "images/tabbar/buycar_sel.png"
36 | },
37 | {
38 | "pagePath": "pages/user_info/user_info",
39 | "text": "我的",
40 | "iconPath": "images/tabbar/me.png",
41 | "selectedIconPath": "images/tabbar/me_sel.png"
42 | }
43 | ]
44 | },
45 | "debug": false
46 | }
--------------------------------------------------------------------------------
/pages/index/goods_classification/goods_classification.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {{item.cate_name}}
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | {{item.name}}
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | 命名规范
2 | 1.JS用驼峰法命名
3 | 2.css中class命名用"-"分隔,ID用"_"
4 | 3.接口中数据用"_"分隔
5 | 4.文件/文件夹命名用"_"
6 | JS使用规范
7 | 使用ECMAScript 2016
8 | pages里的文件结构
9 | 根据tabbar放入对应的文件夹中,三个入口页面文件放入外层
10 | 静态文件
11 | 图片小图使用雪碧图
12 | 对应文件的图片都需要新建对应的文件夹存放图片
13 | 代码管理
14 | 使用Git,上传代码时请不要上传app.js和app.json,避免本地请求变为服务器请求
15 |
16 | 开发中遇到的坑:
17 | 1. JS方面
18 | 不支持DOM操作,需要在开发时能够设置好所有需要的data属性值,然后渲染
19 | 跳转到tabbar页面的时候只能使用wx.switchTab(OBJECT)
20 | wx.showToast()配置样式单一,且宽度不能自适应
21 |
22 | 2. wxml方面
23 | 标签不够语义化
24 | 3. wxss方面
25 | 不支持"a > b > c"双箭头写法,控制台会报错
26 | 背景图属性background-image必须写在标签中,或者使用服务器上的图片
27 | 使用display:flex布局方式,容器大小会随内容大小变化,所以,最好给容器设置宽度
28 | 标注图标注的大小再设置时是原大小的2倍,比如图上标注10*10,css这边写20rpx*20rpx
29 | 4. 其它方面
30 | json文件是配置window窗口的,但是此时可以省略window属性,如果加window则没有效果,也不会报错
31 |
32 | 项目中使用过的API:
33 | 1.ES6相关
34 | 对象解构 {} = {}
35 | 箭头函数 =>
36 | 块级变量let、const
37 | 模板字符串${...}
38 | 数组扩展let c = [...a,...b]
39 |
40 | 2.微信相关
41 | WXML
42 | 组件:view、text、image、icon、swiper、progress、navigator、button、input
43 | template模板
44 | 列表渲染:wx:for="" wx:key=""
45 | 条件渲染:wx:if="" elif="" else
46 |
47 | WXSS
48 | flex布局
49 | rpx自适应宽度
50 |
51 | JS相关封装
52 | 动态设置数据:setData()
53 | 发送接口请求:wx.request(OBJECT)
54 | 页面链接:wx.navigateTo()、wx.navigateBack()
55 | 页面弹框反馈:wx.showToast(OBJECT)、wx.showModal(OBJECT)
56 | 本地存储: wx.setStorageSync()、wx.getStorageSync()
57 | 绑定事件:bindtap、onReachBottom
58 |
59 |
--------------------------------------------------------------------------------
/test/GetCoupon:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "coupon_id": "001",
4 | "coupon_status": "0",
5 | "coupon_img_url": "../../../images/user_info/coupon_03.png",
6 | "discount_amount": "10",
7 | "use_case": "100",
8 | "show_list": "false",
9 | "description": "[WESHIGERE官方旗舰店]可用"
10 | },
11 | {
12 | "coupon_id": "002",
13 | "coupon_status": "1",
14 | "coupon_img_url": "../../../images/user_info/coupon_03.png",
15 | "discount_amount": "100",
16 | "use_case": "1000",
17 | "show_list": "false",
18 | "description": "[WESHIGERE官方旗舰店]可用"
19 | },
20 | {
21 | "coupon_id": "003",
22 | "coupon_status": "0",
23 | "coupon_img_url": "../../../images/user_info/coupon_03.png",
24 | "discount_amount": "100",
25 | "use_case": "1000",
26 | "show_list": "false",
27 | "description": "[WESHIGERE官方旗舰店]可用"
28 | },
29 | {
30 | "coupon_id": "004",
31 | "coupon_status": "1",
32 | "coupon_img_url": "../../../images/user_info/coupon_03.png",
33 | "discount_amount": "200",
34 | "use_case": "1500",
35 | "show_list": "false",
36 | "description": "[WESHIGERE官方旗舰店]可用"
37 | },
38 | {
39 | "coupon_id": "005",
40 | "coupon_status": "0",
41 | "coupon_img_url": "../../../images/user_info/coupon_03.png",
42 | "discount_amount": "200",
43 | "use_case": "1500",
44 | "show_list": "false",
45 | "description": "[WESHIGERE官方旗舰店]可用"
46 | }
47 | ]
--------------------------------------------------------------------------------
/pages/index/goods_classification/goods_classification.js:
--------------------------------------------------------------------------------
1 | // pages/index/goods_classification/goods_classification.js
2 | //获取应用实例
3 | const {
4 | http,
5 | Modal,
6 | PageContent
7 | } = require("../../../utils/util.js");
8 | Page({
9 |
10 | /**
11 | * 页面的初始数据
12 | */
13 | data: {
14 | placeholder: "搜索京东商品",
15 | cate_items: [], //需要加载的商品信息
16 | "cur_nav": "1", //默认选中的菜单项
17 | "cur_index": "0" //默认加载的菜单数据
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | * @pram options--页面跳转带来的参数
23 | */
24 | onLoad: function (options) {
25 | const _this = this;
26 | http({
27 | url: "GetClassification",
28 | loading: true,
29 | func: (data) => {
30 | //请求成功后
31 | _this.setData({
32 | cate_items: data
33 | })
34 | }
35 | });
36 | },
37 |
38 | /**
39 | *进入搜索页面
40 | */
41 | goSearch: function () {
42 | PageContent.loadNavigate("../search/search");
43 | },
44 |
45 | /**
46 | * 点击左侧菜单切换
47 | * @pram e--当前点击对象的属性集合
48 | */
49 | switchRightTab: function (e) {
50 | this.setData({
51 | cur_nav: e.target.dataset.id,
52 | cur_index: e.target.dataset.index
53 | })
54 | },
55 |
56 | /**
57 | * 点击商品进入详情
58 | * @pram e--当前点击对象的属性集合
59 | */
60 | goDetail(e) {
61 | PageContent.loadNavigate("../../cart/goods_detail/goods_detail");
62 | }
63 | });
--------------------------------------------------------------------------------
/pages/index/goods_classification/goods_classification.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/goods_classification/goods_classification.wxss */
2 | page{
3 | background-color: #fff;
4 | }
5 | .top-content{
6 | border-top:1rpx solid #e4e4e4;
7 | border-bottom:1rpx solid #e4e4e4;
8 | }
9 | .search{
10 | position: relative;
11 | padding:22rpx 0;
12 | border-top: 1px solid #f1f1f1;
13 | border-bottom: 1px solid #f1f1f1;
14 | }
15 | .static{
16 | position: absolute;
17 | top:32rpx;
18 | left:254rpx;
19 | z-index:2;
20 | }
21 | .active{
22 | font-size:0;
23 | position:absolute;
24 | top:36rpx;
25 | left:62rpx;
26 | z-index:2;
27 | }
28 | .search input{
29 | width: 670rpx;
30 | height: 58rpx;
31 | margin:0 auto;
32 | background: #f1f1f1;
33 | font-size:28rpx;
34 | color: #8d8d8d;
35 | border-radius: 35rpx;
36 | text-align: center;
37 | line-height: 58rpx;
38 | }
39 | .main-content{
40 | overflow: hidden;
41 | width:670rpx;
42 | margin:0 auto;
43 | }
44 | .left-content{
45 | float: left;
46 | width:140rpx;
47 | }
48 | .right-content{
49 | float: right;
50 | width:520rpx;
51 | }
52 | .nav-right{
53 | display: flex;
54 | flex-wrap: wrap;
55 | }
56 | .nav-left-item{
57 | margin-bottom:100rpx;
58 | }
59 | .nav-right-items{
60 | display: flex;
61 | flex-direction: column;
62 | align-items: center;
63 | margin: 40rpx 36rpx 18rpx 36rpx;
64 | }
65 | .nav-right-items image{
66 | width: 95rpx;
67 | height: 125rpx;
68 | }
69 | .nav-right-items text{
70 | margin-top:18rpx;
71 | }
72 | .main-content{
73 | margin-top:50rpx;
74 | }
--------------------------------------------------------------------------------
/pages/index/search/search.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/search/search.wxss */
2 | .search-title{
3 | margin:0 20rpx;
4 | }
5 | .search-bar{
6 | display: flex;
7 | position: relative;
8 | margin-bottom:14rpx;
9 | }
10 | .search{
11 | position: absolute;
12 | z-index: 2;
13 | left:16rpx;
14 | top:10rpx;
15 | }
16 | .cancel-icon{
17 | position: absolute;
18 | right:150rpx;
19 | z-index:2;
20 | top:10rpx;
21 | }
22 | .search-bar>input{
23 | width:508rpx;
24 | height:60rxp;
25 | border-radius:25rpx;
26 | background-color:#e9e8ee;
27 | padding-left:60rpx;
28 |
29 | }
30 | .placeholder{
31 | font-size:28rpx;
32 | color: #d6d6d9;
33 | }
34 | .cancel{
35 | width:120rpx;
36 | height:54rpx;
37 | font-size:26rpx;
38 | line-height:54rpx;
39 | }
40 | .search-btn{
41 | width:120rpx;
42 | height:54rpx;
43 | font-size:26rpx;
44 | line-height:54rpx;
45 | color: #fff;
46 | background-color: #f23030;
47 | }
48 | .content{
49 | border-top:1rpx solid #e2e2e2;
50 | }
51 | .wrap-content{
52 | margin:33rpx 20rpx 0 20rpx;
53 | }
54 | .content-title{
55 | margin-bottom:29rpx;
56 | display: flex;
57 | justify-content: space-between;
58 | }
59 | .content-title text:nth-child(1){
60 | font-size: 26rpx;
61 | color: #2d2d2d;
62 | font-weight: 700;
63 | }
64 | .content-title text:nth-child(2){
65 | font-size: 22rpx;
66 | color: #b94358;
67 | margin-right:22rpx;
68 | }
69 | .tags{
70 | font-size:22rpx;
71 | display: flex;
72 | /*justify-content: space-around;*/
73 | flex-wrap: wrap;
74 |
75 | }
76 | .tags>text{
77 | padding:10rpx 20rpx;
78 | background: #e9e8ee;
79 | margin-right:14rpx;
80 | margin-bottom:14rpx;
81 | }
82 |
83 | .bod-style{
84 | border-bottom: 1rpx solid #e9e8ee;
85 | text-indent: 10rpx;
86 | padding-bottom: 15rpx;
87 | }
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/pages/user_info/user_info.wxss:
--------------------------------------------------------------------------------
1 | .my-container {
2 | width: 100%;
3 | }
4 | .user-wechat-info {
5 | width: 100%;
6 | height: 192rpx;
7 | background-color: #E45050;
8 | overflow: hidden;
9 | }
10 | .order-details {
11 | width: 100%;
12 | height: 342rpx;
13 | background-color: white;
14 | margin-top: 19rpx;
15 | }
16 | .order-detail {
17 | width: 100%;
18 | height: 85rpx;
19 | background-color: white;
20 | }
21 | .order-detail:not(:last-child) {
22 | border-bottom: 1rpx solid #e9e8ed;
23 | }
24 | .order-detail:last-child {
25 | border-bottom: 1rpx solid #e9e8ed;
26 | }
27 | .discount-coupon {
28 | width: 100%;
29 | height: 85rpx;
30 | background-color: white;
31 | margin-top: 19rpx;
32 | }
33 | .detail_info {
34 | width: 682rpx;
35 | margin: 0 auto;
36 | }
37 | .user-wechat-info > image {
38 | width: 96rpx;
39 | height: 96rpx;
40 | margin: 42rpx 30rpx 42rpx 40rpx;
41 | border: 4rpx solid #BA4356;
42 | border-radius: 50%;
43 | display: block;
44 | float: left;
45 | }
46 | .words-info {
47 | float: left;
48 | height: 96rpx;
49 | margin: 42rpx 0;
50 | }
51 | .nick-name {
52 | color: white;
53 | }
54 | .jd-account {
55 | color: #FFC7BC;
56 | font-size: 24rpx;
57 | margin-top: 22rpx;
58 | }
59 | .detail-info {
60 | height: 40rpx;
61 | padding: 22rpx 20rpx;
62 | }
63 | .order-icon {
64 | width: 39rpx;
65 | height: 41rpx;
66 | display: block;
67 | float: left;
68 | margin-right: 24rpx;
69 | }
70 | .detail-info > .item-name {
71 | display: block;
72 | float: left;
73 | line-height: 42rpx;
74 | }
75 | .right-array {
76 | width: 16rpx;
77 | height: 25rpx;
78 | float: right;
79 | margin-top: 10rpx;
80 | }
81 | .detail-info > .item-num {
82 | display: block;
83 | float: right;
84 | line-height: 42rpx;
85 | font-size: 24rpx;
86 | color:#c81624;
87 | margin-right: 28rpx;
88 | }
89 |
90 |
--------------------------------------------------------------------------------
/test/GetOrderDetail:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "order_id": "001",
4 | "order_status": "0",
5 | "order_number": "112233",
6 | "ordered_time": "2017-9-1 11:58",
7 | "consignee_address": "成都高新区天府软件园C区7栋",
8 | "invoice_info": "普通发票个人明细",
9 | "consignee_name": "Miya",
10 | "order_price": "334.00",
11 | "discount_money": "0.00",
12 | "freight_change": "12.00",
13 | "actual_amount": "346.00",
14 | "goods_brand": "JD 京东",
15 | "order_goods": [
16 | {
17 | "img_url": "../../../images/buycar/mask.jpg",
18 | "goods_id": "0011",
19 | "goods_quantity": "2",
20 | "goods_price": "220.00",
21 | "goods_description": "【京东超市】Mediheal可莱丝美迪惠尔水润保湿面膜10片水库针剂(保湿补水男女士 护肤品)"
22 | },
23 | {
24 | "img_url": "../../../images/buycar/2.jpg",
25 | "goods_id": "0012",
26 | "goods_quantity": "1",
27 | "goods_price": "114.00",
28 | "goods_description": "连夏阁 大码休闲套装女2017夏季新款修身时尚裤腿短裤短袖雪纺衫两件套女装 荧光绿套装裤 XL"
29 | }
30 | ]
31 | },
32 | {
33 | "order_id": "002",
34 | "order_status": "1",
35 | "order_number": "112234",
36 | "ordered_time": "2017-9-1 12:00",
37 | "consignee_address": "成都高新区天府软件园C区7栋",
38 | "consignee_name": "Miya",
39 | "invoice_info": "普通发票个人明细",
40 | "order_price": "116.00",
41 | "discount_money": "8.00",
42 | "freight_change": "12.00",
43 | "actual_amount": "120.00",
44 | "goods_brand": "JD 京东",
45 | "order_goods": [
46 | {
47 | "goods_id": "0021",
48 | "img_url": "../../../images/index/goods_item01.png",
49 | "goods_quantity": "1",
50 | "goods_price": "116.00",
51 | "goods_description": "【厂家直销】 【两件减8元】比达尼 2017夏装新款修身气"
52 | }
53 | ]
54 | }
55 | ]
--------------------------------------------------------------------------------
/test/getReceivedCoupon:
--------------------------------------------------------------------------------
1 | {
2 | "not_used_coupon": [
3 | {
4 | "use_condition": "",
5 | "discount_amount": "30",
6 | "description": "仅可购买长虹电视指定商品",
7 | "use_time_range": "2017.9.1-2017.9.15"
8 | },
9 | {
10 | "use_condition": "500",
11 | "discount_amount": "50",
12 | "description": "仅可购买长虹电视指定商品",
13 | "use_time_range": "2017.9.20-2017.9.25"
14 | },
15 | {
16 | "use_condition": "100",
17 | "discount_amount": "60",
18 | "description": "仅可购买质高空调指定商品",
19 | "use_time_range": "2017.9.22-2017.9.25"
20 | },
21 | {
22 | "use_condition": "1500",
23 | "discount_amount": "70",
24 | "description": "仅可购买质高空调指定商品",
25 | "use_time_range": "2017.9.25-2017.9.31"
26 | },
27 | {
28 | "use_condition": "2000",
29 | "discount_amount": "100",
30 | "description": "仅可购买质高空调指定商品",
31 | "use_time_range": "2017.9.1-2017.9.31"
32 | }
33 | ],
34 | "expired_coupon": [
35 | {
36 | "use_condition": "",
37 | "discount_amount": "30",
38 | "description": "仅可购买长虹电视指定商品",
39 | "use_time_range": "2017.8.1-2017.8.15"
40 | },
41 | {
42 | "use_condition": "500",
43 | "discount_amount": "50",
44 | "description": "仅可购买长虹电视指定商品",
45 | "use_time_range": "2017.8.20-2017.8.25"
46 | },
47 | {
48 | "use_condition": "100",
49 | "discount_amount": "60",
50 | "description": "仅可购买质高空调指定商品",
51 | "use_time_range": "2017.8.22-2017.8.25"
52 | },
53 | {
54 | "use_condition": "1500",
55 | "discount_amount": "70",
56 | "description": "仅可购买质高空调指定商品",
57 | "use_time_range": "2017.8.25-2017.8.31"
58 | }
59 | ],
60 | "used_coupon": []
61 | }
--------------------------------------------------------------------------------
/pages/index/search/search.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 历史搜索
18 |
19 | 清除
20 |
21 |
22 |
23 |
24 | {{item}}
25 |
26 |
27 |
28 | 热门搜索
29 | 换一批
30 |
31 |
32 |
33 |
34 | {{item}}
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | {{active_search_val}}
43 |
44 |
45 |
--------------------------------------------------------------------------------
/pages/user_info/my_order/my_order.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user_info/my_order/my_order.wxss */
2 | .my-container {
3 | width: 100%;
4 | }
5 | .head-nav {
6 | width: 100%;
7 | height: 94rpx;
8 | background-color: white;
9 | border-top: 2rpx solid #e9e8ed;
10 | border-bottom: 2rpx solid #e9e8ed;
11 | display: flex;
12 | flex-direction: row;
13 | }
14 | .head-nav > view {
15 | flex: 1;
16 | text-align: center;
17 | line-height: 94rpx;
18 | }
19 | .active-item {
20 | color: #D74053;
21 | border-bottom: 4rpx solid #D74053;
22 | }
23 | .no-order {
24 | width: 100%;
25 | text-align: center;
26 | color: #5B5A60;
27 | margin-top: 60rpx;
28 | }
29 |
30 | .has-order {
31 | font-size: 24rpx;
32 | }
33 | .has-order >view {
34 | background-color: white;
35 | }
36 | .has-order > view:not(:nth-child(1)) {
37 | margin-top: 20rpx;
38 | }
39 | .order-head {
40 | height: 75rpx;
41 | padding: 25rpx 20rpx;
42 | border: 2rpx solid #F0F0F0;
43 | }
44 | .status-price {
45 | width: 230rpx;
46 | height: 70rpx;
47 | float: left;
48 | }
49 | .status-price > view {
50 | color: #949494;
51 | }
52 | .status-price > view text {
53 | color: black;
54 | line-height: 38rpx;
55 | }
56 | .unpaid-color {
57 | color: #E64240 !important;
58 | }
59 | .to-pay-btn {
60 | float: right;
61 | color: white;
62 | }
63 | .to-pay-btn > button {
64 | width: 160rpx;
65 | height: 56rpx;
66 | background-color: #E64240;
67 | color: white;
68 | font-size:24rpx;
69 | line-height:56rpx;
70 | margin-top: 8rpx;
71 | }
72 | .goods-content {
73 | margin: 0 20rpx;
74 | }
75 | .goods-info {
76 | width: 100%;
77 | height: 140rpx;
78 | border-bottom: 1rpx solid #E2E2E2;
79 | padding: 28rpx 0;
80 | }
81 | .goods-info > image {
82 | width: 140rpx;
83 | height: 140rpx;
84 | display: inline-block;
85 | float: left;
86 | }
87 | .goods-info > view {
88 | width: 530rpx;
89 | height: 140rpx;
90 | line-height: 45rpx;
91 | display: inline-block;
92 | float: right;
93 | }
94 | .goods-quantity {
95 | color: #949494;
96 | display: block;
97 | }
98 |
--------------------------------------------------------------------------------
/pages/index/search_result/search_result.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | {{item.title}}
39 |
40 | ¥
41 | {{item.price}}.00
42 |
43 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/test/GetSearchRulesBySale:
--------------------------------------------------------------------------------
1 | {
2 | "search_products": [
3 | {
4 | "id": "000001",
5 | "image_url": "../../../images/index/result_image02.png",
6 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
7 | "price": "24854",
8 | "num_comment": "2",
9 | "good_comment_percent": "100"
10 | },
11 | {
12 | "id": "000002",
13 | "image_url": "../../../images/index/result_image03.png",
14 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
15 | "price": "4580",
16 | "num_comment": "2",
17 | "good_comment_percent": "100"
18 | },
19 | {
20 | "id": "000003",
21 | "image_url": "../../../images/index/result_image01.png",
22 | "title": "金龙珠宝 黄金手表 黄金手镯手链 女士石英石金表 足金999.9时尚腕表 霸气貔貅手链首饰改运势",
23 | "price": "9585",
24 | "num_comment": "2",
25 | "good_comment_percent": "100"
26 | },
27 | {
28 | "id": "000003",
29 | "image_url": "../../../images/index/result_image02.png",
30 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
31 | "price": "12005",
32 | "num_comment": "2",
33 | "good_comment_percent": "100"
34 | },
35 | {
36 | "id": "000003",
37 | "image_url": "../../../images/index/result_image03.png",
38 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
39 | "price": "10200",
40 | "num_comment": "2",
41 | "good_comment_percent": "100"
42 | },
43 | {
44 | "id": "000001",
45 | "image_url": "../../../images/index/result_image03.png",
46 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
47 | "price": "85555",
48 | "num_comment": "2",
49 | "good_comment_percent": "100"
50 | },
51 | {
52 | "id": "000002",
53 | "image_url": "../../../images/index/result_image01.png",
54 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
55 | "price": "1",
56 | "num_comment": "2",
57 | "good_comment_percent": "100"
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/test/GetSearchRulesByComprehensive:
--------------------------------------------------------------------------------
1 | {
2 | "search_products": [
3 | {
4 | "id": "000001",
5 | "image_url": "../../../images/index/result_image02.png",
6 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
7 | "price": "24854",
8 | "num_comment": "2",
9 | "good_comment_percent": "100"
10 | },
11 | {
12 | "id": "000002",
13 | "image_url": "../../../images/index/result_image01.png",
14 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
15 | "price": "15312",
16 | "num_comment": "2",
17 | "good_comment_percent": "100"
18 | },
19 | {
20 | "id": "000003",
21 | "image_url": "../../../images/index/result_image03.png",
22 | "title": "金龙珠宝 黄金手表 黄金手镯手链 女士石英石金表 足金999.9时尚腕表 霸气貔貅手链首饰改运势",
23 | "price": "12300",
24 | "num_comment": "2",
25 | "good_comment_percent": "100"
26 | },
27 | {
28 | "id": "000003",
29 | "image_url": "../../../images/index/result_image01.png",
30 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
31 | "price": "35820",
32 | "num_comment": "2",
33 | "good_comment_percent": "100"
34 | },
35 | {
36 | "id": "000003",
37 | "image_url": "../../../images/index/result_image02.png",
38 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
39 | "price": "999",
40 | "num_comment": "2",
41 | "good_comment_percent": "100"
42 | },
43 | {
44 | "id": "000001",
45 | "image_url": "../../../images/index/result_image03.png",
46 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
47 | "price": "68885",
48 | "num_comment": "2",
49 | "good_comment_percent": "100"
50 | },
51 | {
52 | "id": "000002",
53 | "image_url": "../../../images/index/result_image02.png",
54 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
55 | "price": "425",
56 | "num_comment": "2",
57 | "good_comment_percent": "100"
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/pages/user_info/my_order/my_order.js:
--------------------------------------------------------------------------------
1 | // pages/user_info/my_order/my_order.js
2 | const {http,PageContent} = require('../../../utils/util.js');
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | navTabs: ["全部订单", "待付款", "待收货"],
10 | // 初始化将activeIndex置为空
11 | activeIndex: "",
12 | // 初始化将paidOrder置为空数组
13 | paidOrder: [],
14 | // 初始化将unpaidOrder置为空数组
15 | unpaidOrder: [],
16 | // 初始化将allOrder置为空数组
17 | allOrder: []
18 |
19 | },
20 | /**
21 | * 生命周期函数--监听页面加载
22 | */
23 | onLoad: function (options) {
24 | const that = this;
25 | // 调接口GetReceivedCoupon
26 | http({
27 | url: "GetMyOrder",
28 | loading: true,
29 | func: function (data) {
30 | // 定义unpaidOrder和canceledOrder
31 | let unpaidOrder = [],
32 | paidOrder = [];
33 | // 遍历data,将数据重新组合
34 | for (let i = 0; i < data.length; i++) {
35 | // 订单状态为0,为待付款订单,加入unpaidOrder
36 | if (data[i]["order_status"] == "0") {
37 | unpaidOrder.push(data[i]);
38 | }
39 | // 订单状态为2,为已支付,paidOrder
40 | if (data[i]["order_status"] == "2") {
41 | paidOrder.push(data[i]);
42 | }
43 | }
44 | that.setData({
45 | allOrder: data,
46 | unpaidOrder: unpaidOrder,
47 | paidOrder: paidOrder
48 | });
49 | }
50 | });
51 | that.setData({
52 | // 此处获取的activeIndex为user_info页面navigator传过来的参数
53 | activeIndex: options.activeIndex
54 | });
55 | },
56 | /**
57 | * nav item的tap事件
58 | */
59 | tapNavItem: function (e) {
60 | this.setData({
61 | activeIndex: e.currentTarget.id
62 | });
63 | },
64 |
65 | /**
66 | * tap当前订单去当前订单详情页
67 | */
68 | showOrderDetail: function (e) {
69 | // 获取当前订单的ID作为值传入url中
70 | const order_id = e.currentTarget.id;
71 | PageContent.loadNavigate(`../order_detail/order_detail?order_id=${order_id}`)
72 | }
73 | });
--------------------------------------------------------------------------------
/pages/user_info/my_order/my_order.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 状态: 待支付
8 | 状态: 已取消
9 | 状态: 已支付
10 | 总价: ¥{{item.order_price}}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{item.goods_description}}
21 | {{item.goods_quantity}}件
22 |
23 |
24 |
25 |
26 |
27 | 您暂时还没有该类订单
28 |
29 |
30 |
31 |
32 |
33 | {{item}}
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/pages/user_info/received_coupons/received_coupons.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | ¥{{item.discount_amount}}
10 |
11 |
12 | 满{{item.use_condition}}可用
13 | 无金额门槛
14 | {{item.description}}
15 |
16 |
17 |
18 | 全平台
19 | {{item.use_time_range}}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | 您当前暂无该类优惠券
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | {{item}}
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/test/GetSearchResult:
--------------------------------------------------------------------------------
1 | {
2 | "search_products": [
3 | {
4 | "id": "000001",
5 | "image_url": "../../../images/index/result_image01.png",
6 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
7 | "price": "24854",
8 | "num_comment": "2",
9 | "good_comment_percent": "100"
10 | },
11 | {
12 | "id": "000002",
13 | "image_url": "../../../images/index/result_image02.png",
14 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
15 | "price": "15312",
16 | "num_comment": "2",
17 | "good_comment_percent": "100"
18 | },
19 | {
20 | "id": "000003",
21 | "image_url": "../../../images/index/result_image03.png",
22 | "title": "金龙珠宝 黄金手表 黄金手镯手链 女士石英石金表 足金999.9时尚腕表 霸气貔貅手链首饰改运势",
23 | "price": "12300",
24 | "num_comment": "2",
25 | "good_comment_percent": "100"
26 | },
27 | {
28 | "id": "000003",
29 | "image_url": "../../../images/index/result_image01.png",
30 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
31 | "price": "999",
32 | "num_comment": "2",
33 | "good_comment_percent": "100"
34 | },
35 | {
36 | "id": "000003",
37 | "image_url": "../../../images/index/result_image02.png",
38 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
39 | "price": "688",
40 | "num_comment": "2",
41 | "good_comment_percent": "100"
42 | },
43 | {
44 | "id": "000001",
45 | "image_url": "../../../images/index/result_image01.png",
46 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
47 | "price": "525",
48 | "num_comment": "2",
49 | "good_comment_percent": "100"
50 | },
51 | {
52 | "id": "000002",
53 | "image_url": "../../../images/index/result_image02.png",
54 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
55 | "price": "1",
56 | "num_comment": "2",
57 | "good_comment_percent": "100"
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/test/GetPriceByLowToHigh:
--------------------------------------------------------------------------------
1 | {
2 | "search_products": [
3 | {
4 | "id": "000001",
5 | "image_url": "../../../images/index/result_image01.png",
6 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
7 | "price": "1",
8 | "num_comment": "2",
9 | "good_comment_percent": "100"
10 | },
11 | {
12 | "id": "000002",
13 | "image_url": "../../../images/index/result_image02.png",
14 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
15 | "price": "525",
16 | "num_comment": "2",
17 | "good_comment_percent": "100"
18 | },
19 | {
20 | "id": "000003",
21 | "image_url": "../../../images/index/result_image03.png",
22 | "title": "金龙珠宝 黄金手表 黄金手镯手链 女士石英石金表 足金999.9时尚腕表 霸气貔貅手链首饰改运势",
23 | "price": "999",
24 | "num_comment": "2",
25 | "good_comment_percent": "100"
26 | },
27 | {
28 | "id": "000003",
29 | "image_url": "../../../images/index/result_image01.png",
30 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
31 | "price": "12358",
32 | "num_comment": "2",
33 | "good_comment_percent": "100"
34 | },
35 | {
36 | "id": "000003",
37 | "image_url": "../../../images/index/result_image02.png",
38 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
39 | "price": "19999",
40 | "num_comment": "2",
41 | "good_comment_percent": "100"
42 | },
43 | {
44 | "id": "000001",
45 | "image_url": "../../../images/index/result_image01.png",
46 | "title": "赛菲尔足金999.9黄金手链 足金手表链男款 土豪老板链 霸气貔貅手链首饰改运势",
47 | "price": "35552",
48 | "num_comment": "2",
49 | "good_comment_percent": "100"
50 | },
51 | {
52 | "id": "000002",
53 | "image_url": "../../../images/index/result_image02.png",
54 | "title": "299元/克 熙禧珠宝 999足金马鞭手链男士黄金手链 经典双幅口 马鞭土豪改变运势",
55 | "price": "58877",
56 | "num_comment": "2",
57 | "good_comment_percent": "100"
58 | }
59 | ]
60 | }
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //获取应用实例,请求数据的方法
2 | const {
3 | http,
4 | PageContent
5 | } = require("../../utils/util.js");
6 |
7 | Page({
8 | data: {
9 | num: 1, //默认选中抢购的第一项
10 | products_data: {}, //页面秒杀商品的信息
11 | is_hide_loadmore: true //控制加载更多的显示
12 | },
13 |
14 | /**
15 | * 页面加载时
16 | */
17 | onLoad: function () {
18 | //保存this对象
19 | const _this = this;
20 | //请求数据
21 | http({
22 | url: "GetSeckillProducts",
23 | loading: true,
24 | func: (data) => {
25 | // 成功后加载页面
26 | _this.initPage(data["products_data"]);
27 | }
28 | });
29 | },
30 |
31 | /**
32 | * 初始化页面
33 | * @pram data--页面加载的数据
34 | */
35 | initPage: function (data) {
36 | this.setData({
37 | products_data: data
38 | });
39 | },
40 |
41 | /**
42 | * 点击抢购的时间切换样式
43 | * @pram e--当前点击对象的属性集合
44 | */
45 | clickNum: function (e) {
46 | if (e.target.dataset.num) {
47 | //设置当前点击的项为选中样式
48 | this.setData({
49 | num: e.target.dataset.num
50 | })
51 | }
52 | },
53 |
54 | /**
55 | * 点击searchbar进入搜索页面
56 | */
57 | goSearchPage: function () {
58 | // 跳转到search页面
59 | PageContent.loadNavigate("search/search");
60 | },
61 |
62 | /**
63 | * 点击商品进入商品对应的详情页
64 | * @pram e--当前点击对象的属性集合
65 | */
66 | goDetail: (e) => {
67 | // 带上商品id跳转商品详情页
68 | PageContent.loadNavigate(`../cart/goods_detail/goods_detail?product_id=${e.currentTarget.dataset.id}`);
69 | },
70 |
71 | /**
72 | * 下拉加载更多
73 | */
74 | onReachBottom: function () {
75 | //保存this对象
76 | const _this = this;
77 | //页面已存在的商品数据
78 | let exsit_data = _this.data.products_data,
79 | products_data;
80 | //请求数据
81 | http({
82 | url: "GetSeckillProducts",
83 | loading: true,
84 | func: (data) => {
85 | //合并已有的数据和请求到加载更多的数据
86 | products_data = [...exsit_data, ...data["products_data"]];
87 | // 成功后加载页面
88 | _this.setData({
89 | products_data: products_data,
90 | is_hide_loadmore: false
91 | });
92 | }
93 | });
94 | }
95 | });
96 |
--------------------------------------------------------------------------------
/pages/user_info/user_info.js:
--------------------------------------------------------------------------------
1 | const app = getApp();
2 | const tapItemArray = [];
3 | const {http} = require('../../utils/util.js');
4 | Page({
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | wechatInfo: {}, // 初始化账户信息,包括头像、昵称等
10 | allOrders: "", // 初始化订单数量
11 | unpaidOrder: "", // 初始化待付款订单数量
12 | notReceivedOrder: "", // 初始化待收货订单数量
13 | discountCard: "" // 初始化优惠券数量
14 | },
15 | /**
16 | * 点击弹出售后订单后台设置提示
17 | */
18 | tapPaidOrder: () => {
19 | wx.showModal({
20 | title: `请至"微信-发现-购物-个人中心"进行售后订单管理`,
21 | confirmText: "知道了",
22 | confirmColor: "#E45050",
23 | showCancel: false,
24 | success: function (res) {
25 |
26 | }
27 | });
28 | },
29 | /**
30 | * 生命周期函数--监听页面加载
31 | */
32 | onLoad: function () {
33 | const that = this;
34 | // 调用getWechatInfo获取userInfo
35 | app.getWechatInfo(function (userInfo) {
36 | //更新数据
37 | that.setData({
38 | wechatInfo: userInfo
39 | });
40 | });
41 | // 调接口GetOrderNum
42 | http({
43 | url: "GetOrderNum",
44 | loading: true,
45 | func: function(data){
46 | that.setData({
47 | allOrders: data["all_orders"] ? data["all_orders"]+"单" : "",
48 | unpaidOrder: data["unpaid_order"] ? data["unpaid_order"]+"单" : "",
49 | notReceivedOrder: data["not_received_order"] ? data["not_received_order"]+"单" : "",
50 | discountCard: data["discount_card"] ? data["all_orders"]+"单" : ""
51 | });
52 | }
53 | });
54 | },
55 |
56 | /**
57 | * 生命周期函数--监听页面初次渲染完成
58 | */
59 | onReady: function () {
60 |
61 | },
62 |
63 | /**
64 | * 生命周期函数--监听页面显示
65 | */
66 | onShow: function () {
67 | },
68 |
69 | /**
70 | * 生命周期函数--监听页面隐藏
71 | */
72 | onHide: function () {
73 |
74 | },
75 |
76 | /**
77 | * 生命周期函数--监听页面卸载
78 | */
79 | onUnload: function () {
80 |
81 | },
82 |
83 | /**
84 | * 页面相关事件处理函数--监听用户下拉动作
85 | */
86 | onPullDownRefresh: function () {
87 |
88 | },
89 |
90 | /**
91 | * 页面上拉触底事件的处理函数
92 | */
93 | onReachBottom: function () {
94 |
95 | },
96 |
97 | /**
98 | * 用户点击右上角分享
99 | */
100 | onShareAppMessage: function () {
101 |
102 | }
103 | })
--------------------------------------------------------------------------------
/pages/user_info/received_coupons/received_coupons.js:
--------------------------------------------------------------------------------
1 | // pages/user_info/received_coupons/received_coupons.js
2 | const {http,PageContent} = require('../../../utils/util.js');
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | // 定义头部tab信息
10 | navTabs: [],
11 | // 定义将activeIndex置为空
12 | activeIndex: "",
13 | // 定义待使用优惠券信息
14 | notUsedCouponInfo: [],
15 | // 定义已使用优惠券信息
16 | usedCouponInfo: [],
17 | // 定义已过期优惠券信息
18 | expiredCouponInfo: [],
19 | couponColor: "item['use_condition'] ? 'green-coupon' : 'red-coupon'"
20 | },
21 | /**
22 | * 生命周期函数--监听页面加载
23 | */
24 | onLoad: function (options) {
25 | const that = this;
26 | // 调接口GetReceivedCoupon
27 | http({
28 | url: "GetReceivedCoupon",
29 | loading: true,
30 | func: function (data) {
31 | // 定义渲染到视图层的数组
32 | let navTabs = [];
33 | // 将返回data重新组合
34 | for (let couponArr in data) {
35 | // 有优惠券信息,length为信息的长度,没有优惠券信息,将lengtgh置为空
36 | let length = data[couponArr].length > 0 ? " " + data[couponArr].length : "";
37 | // 根据couponArr类型做不同字符串拼接
38 | if (couponArr == "not_used_coupon") {
39 | navTabs.push(`待使用${length}`);
40 | } else if (couponArr == "expired_coupon") {
41 | navTabs.push(`已过期${length}`);
42 | } else {
43 | navTabs.push(`已使用${length}`);
44 | }
45 | }
46 | that.setData({
47 | navTabs: navTabs,
48 | notUsedCouponInfo: data["not_used_coupon"],
49 | usedCouponInfo: data["used_coupon"],
50 | expiredCouponInfo: data["expired_coupon"]
51 | });
52 | }
53 | });
54 | that.setData({
55 | // 此处获取的activeIndex为其他页面传过来的参数用于定位优惠券类型
56 | activeIndex: options.activeIndex
57 | });
58 | },
59 | /**
60 | * nav item的tap事件
61 | */
62 | tapNavItem: function (e) {
63 | this.setData({
64 | activeIndex: e.currentTarget.id
65 | });
66 | },
67 | /**
68 | * 点击去领取链接到领券中心
69 | */
70 | toDiscountCenter: function () {
71 | PageContent.loadNavigate("../../index/get_coupons/get_coupons");
72 | }
73 | });
--------------------------------------------------------------------------------
/pages/index/get_coupons/get_coupons.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 今日福利
4 | / 专享福利 天天优惠 /
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{item.description}}
15 |
16 |
17 | {{item.discount_amount}}
18 | 满{{item.use_case}}可用
19 |
20 |
21 |
22 | 立即领取
23 |
24 |
25 | {{item.show_list ? "去使用" : "收起"}}
26 |
27 |
28 |
29 |
30 |
31 | 该券适用于以下商品:
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | {{item.goods_description}}
41 |
42 |
43 | ¥{{item.goods_price}}
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/test/GetCouponGoods:
--------------------------------------------------------------------------------
1 | {
2 | "goods_list": [
3 | {
4 | "page": [
5 | {
6 | "goods_description": "瑞士军刀双肩包,男女学生书包...",
7 | "goods_price": "138.00",
8 | "goods_id": "001",
9 | "goods_url": "../../../images/user_info/goods_03.png"
10 | },
11 | {
12 | "goods_description": "【京东配送】 瑞士军刀双肩电脑包...",
13 | "goods_price": "159.00",
14 | "goods_id": "002",
15 | "goods_url": "../../../images/user_info/goods_05.png"
16 | },
17 | {
18 | "goods_description": "瑞士军刀 男士胸包单肩斜挎包...",
19 | "goods_price": "235.00",
20 | "goods_id": "003",
21 | "goods_url": "../../../images/user_info/goods_07.png"
22 | }
23 | ]
24 | },
25 | {
26 | "page": [
27 | {
28 | "goods_description": "瑞士军刀双肩包,男女学生书包...",
29 | "goods_price": "138.00",
30 | "goods_id": "004",
31 | "goods_url": "../../../images/user_info/goods_03.png"
32 | },
33 | {
34 | "goods_description": "【京东配送】 瑞士军刀双肩电脑包...",
35 | "goods_price": "159.00",
36 | "goods_id": "005",
37 | "goods_url": "../../../images/user_info/goods_05.png"
38 | },
39 | {
40 | "goods_description": "瑞士军刀 男士胸包单肩斜挎包...",
41 | "goods_price": "235.00",
42 | "goods_id": "006",
43 | "goods_url": "../../../images/user_info/goods_07.png"
44 | }
45 | ]
46 | },
47 | {
48 | "page": [
49 | {
50 | "goods_description": "瑞士军刀双肩包,男女学生书包...",
51 | "goods_price": "138.00",
52 | "goods_id": "007",
53 | "goods_url": "../../../images/user_info/goods_03.png"
54 | },
55 | {
56 | "goods_description": "【京东配送】 瑞士军刀双肩电脑包...",
57 | "goods_price": "159.00",
58 | "goods_id": "008",
59 | "goods_url": "../../../images/user_info/goods_05.png"
60 | },
61 | {
62 | "goods_description": "瑞士军刀 男士胸包单肩斜挎包...",
63 | "goods_price": "235.00",
64 | "goods_id": "009",
65 | "goods_url": "../../../images/user_info/goods_07.png"
66 | }
67 | ]
68 | }
69 | ]
70 | }
--------------------------------------------------------------------------------
/pages/user_info/order_detail/order_detail.js:
--------------------------------------------------------------------------------
1 | const {http,PageContent} = require('../../../utils/util.js');
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | // 初始化当前订单详情
9 | cur_order_detail: {}
10 | },
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: function (options) {
16 | let that = this,
17 | // 获取order ID
18 | order_id = options.order_id;
19 | // 调接口GetOrderDetail
20 | http({
21 | url: "GetOrderDetail",
22 | loading: true,
23 | data: {"order_id": order_id},
24 | func: function (data) {
25 | for (let i = 0; i < data.length; i++) {
26 | if (data[i]["order_id"] == order_id) {
27 | // 将获取的当前订单详情赋值给cur_order_detail
28 | that.setData({
29 | cur_order_detail: data[i]
30 | });
31 | }
32 | }
33 | }
34 | });
35 | },
36 |
37 | /**
38 | * tap申请取消订单
39 | */
40 | cancelOrderDlg: function(){
41 | const that = this;
42 | // 获取data中的cur_order_detail
43 | const cur_order_detail = this.data.cur_order_detail;
44 | // 将order_status状态设为1,即订单取消的状态
45 | cur_order_detail.order_status = "1";
46 | wx.showModal({
47 | title: `是否申请取消订单?`,
48 | confirmText: "确定",
49 | confirmColor: "#E45050",
50 | success: function (res) {
51 | // 点确定将页面设为订单取消的状态
52 | if (res.confirm) {
53 | that.setData({
54 | cur_order_detail: cur_order_detail
55 | });
56 | }
57 | }
58 | });
59 | },
60 |
61 | /**
62 | * 点击某一商品链接到该商品的详情页
63 | */
64 | toGoodsDetail: (e) => {
65 | // 获取当前订单的ID作为值传入url中
66 | const goods_id = e.currentTarget.id;
67 | PageContent.loadNavigate(`../../cart/goods_detail/goods_detail?goods_id=${goods_id}`);
68 | },
69 |
70 | /**
71 | * 生命周期函数--监听页面初次渲染完成
72 | */
73 | onReady: function () {
74 |
75 | },
76 |
77 | /**
78 | * 生命周期函数--监听页面显示
79 | */
80 | onShow: function () {
81 |
82 | },
83 |
84 | /**
85 | * 生命周期函数--监听页面隐藏
86 | */
87 | onHide: function () {
88 |
89 | },
90 |
91 | /**
92 | * 生命周期函数--监听页面卸载
93 | */
94 | onUnload: function () {
95 |
96 | },
97 |
98 | /**
99 | * 页面相关事件处理函数--监听用户下拉动作
100 | */
101 | onPullDownRefresh: function () {
102 |
103 | },
104 |
105 | /**
106 | * 页面上拉触底事件的处理函数
107 | */
108 | onReachBottom: function () {
109 |
110 | },
111 |
112 | /**
113 | * 用户点击右上角分享
114 | */
115 | onShareAppMessage: function () {
116 |
117 | }
118 | });
--------------------------------------------------------------------------------
/pages/user_info/user_info.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{wechatInfo.nickName}}
8 |
9 |
10 | XXXXXXXXXXXXXXX
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 全部订单
21 |
22 | {{allOrders}}
23 |
24 |
25 |
26 |
27 |
28 |
29 | 待付款
30 |
31 | {{unpaidOrder}}
32 |
33 |
34 |
35 |
36 |
37 |
38 | 待收货
39 |
40 | {{notReceivedOrder}}
41 |
42 |
43 |
44 |
45 |
46 |
47 | 售后订单
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | 优惠券
57 |
58 | {{discountCard}}
59 |
60 |
61 |
--------------------------------------------------------------------------------
/pages/user_info/received_coupons/received_coupons.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user_info/received_coupons/received_coupons.wxss */
2 | .head-nav {
3 | width: 100%;
4 | height: 94rpx;
5 | background-color: white;
6 | border-top: 2rpx solid #e9e8ed;
7 | border-bottom: 2rpx solid #e9e8ed;
8 | display: flex;
9 | flex-direction: row;
10 | }
11 | .head-nav > view {
12 | flex: 1;
13 | text-align: center;
14 | line-height: 94rpx;
15 | }
16 | .active-item {
17 | color: #D74053;
18 | border-bottom: 4rpx solid #D74053;
19 | }
20 | /*.no-order {*/
21 | /*width: 100%;*/
22 | /*text-align: center;*/
23 | /*font-size: 28rpx;*/
24 | /*color: #5B5A60;*/
25 | /*margin-top: 60rpx;*/
26 | /*}*/
27 | .coupon-content {
28 | width: 100%;
29 | background-color: white;
30 | padding-top: 38rpx;
31 | overflow: hidden;
32 | }
33 | .coupon-content > view {
34 | width: 690rpx;
35 | height: 213rpx;
36 | border-radius: 15rpx;
37 | margin:0 auto;
38 | margin-bottom: 38rpx;
39 | overflow: hidden;
40 | }
41 | .green-coupon {
42 | color: #47C1C4;
43 | border: 1rpx solid #47C1C4;
44 | background-color: #47C1C4;
45 |
46 | }
47 | .red-coupon {
48 | color: #F46366;
49 | border: 1rpx solid #F46366;
50 | background-color: #F46366;
51 | }
52 | .cant-be-used .green-coupon,.cant-be-used .red-coupon{
53 | color: #CCCCCC !important;
54 | border: 1rpx solid #CCCCCC !important;
55 | background-color: #CCCCCC !important;
56 | }
57 | .coupon-time-range {
58 | width: 100%;
59 | height: 62rpx;
60 | overflow: hidden;
61 | }
62 | .coupon-time-range > text {
63 | color: white;
64 | font-size:24rpx;
65 | line-height:62rpx;
66 | display: block;
67 | }
68 | .coupon-time-range > text:nth-child(1) {
69 | float: left;
70 | margin-left: 25rpx;
71 | }
72 | .coupon-time-range > text:nth-child(2) {
73 | float: right;
74 | margin-right: 25rpx;
75 | }
76 | .coupon-info {
77 | width: 100%;
78 | height: 90rpx;
79 | background-color: white;
80 | padding: 30rpx 0;
81 | font-size: 24rpx;
82 | }
83 | .coupon-info > .coupon-info-left {
84 | width: 80rpx;
85 | float: left;
86 | line-height: 90rpx;
87 | margin-left: 26rpx;
88 | }
89 | .coupon-info-left > text {
90 | font-size: 45rpx;
91 | }
92 | .coupon-info > .coupon-info-right {
93 | width: 300rpx;
94 | float: left;
95 | line-height: 45rpx;
96 | margin-left: 90rpx;
97 | }
98 | .coupon-info-right > text {
99 | text-align: center;
100 | display: block;
101 | }
102 |
103 |
104 | .empty-coupon {
105 | width: 345rpx;
106 | margin: 0 auto;
107 | margin-top: 130rpx;
108 | }
109 | .serch-icon-wrap {
110 | width: 178rpx;
111 | height: 178rpx;
112 | background-color: #D6D5DA;
113 | border: 1rpx solid #CDCCD1;
114 | border-radius: 50%;
115 | margin: 0 auto;
116 | overflow: hidden;
117 | }
118 | .serch-icon-wrap > icon {
119 | display: block;
120 | margin: 46rpx;
121 | }
122 | .empty-coupon > text:nth-child(2) {
123 | width:100%;
124 | display:block;
125 | text-align:center;
126 | margin-top:27rpx;
127 | }
128 | button {
129 | width:190rpx;
130 | height:58rpx;
131 | font-size:24rpx;
132 | font-weight:600;
133 | letter-spacing:2px;
134 | margin-top:30rpx;
135 | }
136 |
137 |
138 |
--------------------------------------------------------------------------------
/pages/user_info/order_detail/order_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 您的订单已取消!
5 | 订单取消成功
6 |
7 |
8 |
9 |
10 | 状态:
11 | 待支付
12 | 已取消
13 | 已支付
14 |
15 |
16 | 订单编号:
17 | {{cur_order_detail.order_number}}
18 |
19 |
20 | 下单时间:
21 | {{cur_order_detail.ordered_time}}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | 商品金额:
34 | ¥{{cur_order_detail.actual_amount}}
35 |
36 |
37 | 收货地址:
38 | {{cur_order_detail.consignee_address}}
39 |
40 |
41 | 收货人:
42 | {{cur_order_detail.consignee_name}}
43 |
44 |
45 | 发票信息:
46 | {{cur_order_detail.invoice_info}}
47 |
48 |
49 |
50 |
51 | {{cur_order_detail.goods_brand}}
52 | 共计{{cur_order_detail.order_goods.length}}件商品
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | {{item.goods_description}}
61 |
62 |
63 | ¥{{item.goods_price}}
64 | X{{item.goods_quantity}}
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | 商品总额:
73 | ¥ {{cur_order_detail.actual_amount}}
74 |
75 |
76 | 返现:
77 | - ¥ {{cur_order_detail.discount_money}}
78 |
79 |
80 | 运费:
81 | + ¥ {{cur_order_detail.freight_change}}
82 |
83 |
84 |
85 | 实付金额:
86 | ¥{{cur_order_detail.actual_amount}}
87 |
88 |
89 |
--------------------------------------------------------------------------------
/pages/cart/cart.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 京东自营
9 |
10 |
11 |
12 | 满减
13 | 购满2件,即可享受
14 | 去凑单>
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {{item.describe}}
27 | {{item.specification}}
28 |
29 | ¥{{item.new_price}}
30 |
31 | -
32 |
33 |
34 |
35 | +
36 |
37 |
38 |
39 |
40 |
41 | 删除
42 |
43 |
44 |
45 |
46 |
47 | 去添加点什么吧~
48 |
49 |
50 |
51 |
52 |
53 | 全选
54 |
55 |
56 |
57 | 总计:
58 | ¥{{total_price}}
59 |
60 | 不含运费,已优惠¥{{discount_price}}
61 |
62 |
63 | 去结算({{total_num}})件
64 |
65 |
66 |
67 |
68 |
69 | 全选
70 |
71 |
72 |
73 | 总计:
74 | ¥0
75 |
76 | 不含运费,已优惠¥0
77 |
78 |
79 | 去结算(0)件
80 |
81 |
82 |
--------------------------------------------------------------------------------
/pages/user_info/order_detail/order_detail.wxss:
--------------------------------------------------------------------------------
1 | .my-container {
2 | font-size: 24rpx;
3 | }
4 | .my-container > view {
5 | background-color: white;
6 | }
7 | .head-info {
8 | border-top: 1rpx solid #E1E1E1;
9 | }
10 | .cancel-note {
11 | height:79rpx;
12 | width:100%;
13 | margin-left:20rpx;
14 | line-height:39rpx;
15 | border-bottom:1rpx solid #E1E1E1;
16 | padding:20rpx 0;
17 | }
18 | .cancel-note > text {
19 | display: block;
20 | }
21 | .cancel-note text:nth-child(2) {
22 | color: #9E9E9E;
23 | }
24 | .status-info {
25 | padding:22rpx 20rpx;
26 | line-height:40rpx;
27 | }
28 | .status-info > view,.user-info > view {
29 | color: #9E9E9E;
30 | }
31 | .status-info text,.user-info text{
32 | color: black;
33 | }
34 |
35 | .unpaid-color {
36 | color: #E64240 !important;
37 | }
38 | .buy-again {
39 | padding:0 20rpx;
40 | height:78rpx;
41 | padding-bottom:30rpx;
42 | }
43 | .buy-again > button {
44 | height: 78rpx;
45 | font-size: 28rpx;
46 | line-height: 78rpx;
47 | font-weight: 600;
48 | }
49 | .two-btn {
50 | padding:0 20rpx;
51 | /*height:78rpx;*/
52 | padding-bottom:30rpx;
53 | }
54 | .two-btn > button {
55 | height:78rpx;
56 | font-size:28rpx;
57 | line-height:78rpx;
58 | }
59 | .two-btn > button:nth-child(1){
60 | background-color:#E64240;
61 | color:white;
62 | margin-bottom: 25rpx;
63 | }
64 | .user-info {
65 | height:159rpx;
66 | margin-top:20rpx;
67 | padding:28rpx 20rpx;
68 | line-height:40rpx;
69 | }
70 | .goods-amount-color {
71 | color: #E64240 !important;
72 | }
73 | .consignee-name {
74 | display:inline-block;
75 | margin-left:27rpx;
76 | }
77 | .goods-info {
78 | margin-top: 20rpx;
79 | }
80 | .goods-info-head {
81 | height: 84rpx;
82 | margin-left: 20rpx;
83 | padding-right: 20rpx;
84 | border-bottom:1rpx solid #E1E1E1;
85 | line-height:84rpx;
86 | }
87 | .goods-info-head > text:nth-child(1){
88 | display: inline-block;
89 | float: left;
90 | }
91 | .goods-info-head > text:nth-child(2){
92 | display: inline-block;
93 | float: right;
94 | color: #9E9E9E;
95 | }
96 | .goods-info-body {
97 | height: 130rpx;
98 | padding: 30rpx 20rpx;
99 | }
100 | .goods-info-body > view:nth-child(1) {
101 | float: left;
102 | }
103 | .goods-info-body image {
104 | display: block;
105 | width: 130rpx;
106 | height: 130rpx;
107 | border-radius: 50%;
108 | }
109 | .goods-detail {
110 | width: 548rpx;
111 | float: right;
112 | line-height: 40rpx;
113 | }
114 | .price-quantity {
115 | line-height: 66rpx;
116 | }
117 | .price-quantity > text {
118 | display: block;
119 | }
120 | .price-quantity > text:nth-child(1) {
121 | float: left;
122 | color: #E64240;
123 | }
124 | .price-quantity > text:nth-child(2) {
125 | float: right;
126 | color: #9E9E9E;
127 | }
128 | .money-count {
129 | height: 118rpx;
130 | margin: 0 20rpx;
131 | padding: 25rpx 0;
132 | border-bottom:1rpx solid #E1E1E1;
133 | margin-top: 20rpx;
134 | }
135 | .money-item {
136 | height: 40rpx;
137 | line-height: 40rpx;
138 | }
139 | .money-item > text {
140 | display: block;
141 | }
142 | .money-item > text:nth-child(1){
143 | float: left;
144 | }
145 | .money-item > text:nth-child(2){
146 | float: right;
147 | color: #E64240;
148 | }
149 | .actual-amount {
150 | height: 70rpx;
151 | padding: 0 20rpx;
152 | text-align: right;
153 | line-height: 70rpx;
154 | }
155 | .actual-amount > text {
156 | font-weight: 600;
157 | color: #CD3043;
158 | }
159 |
160 |
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | /******************************存放共通方法*********************************/
2 | /**
3 | * 接口请求方法:wx.request发起的是https请求,一个微信小程序,最高并发数10个
4 | * @param options--调用该方法时传入的对象
5 | */
6 | function http(options) {
7 | // 获取全局对象并进行解构
8 | let {globalData:{baseUrl}} = getApp();
9 | // 页面中若传了loading值,则showLoading
10 | options.loading && Modal.priLoading();
11 | // 发起网络请求
12 | wx.request({
13 | url: `${baseUrl}${options.url}`,
14 | header: {
15 | 'content-type': 'application/xml'
16 | },
17 | data: options.data,
18 | //传参使用post请求,不传参使用get请求
19 | method: options.data ? "POST" : "GET",
20 | success: (res)=> {
21 | // 开启了loading的话先关闭loading
22 | options.loading && Modal.hidePriLoading();
23 | // 在控制台打印接口及接口的返回结果
24 | console.log(options.url + " is success!");
25 | console.log(res.data);
26 | //回调
27 | options.func(res.data);
28 | },
29 | fail: (res)=> {
30 | // 开启了loading的话先关闭loading
31 | options.loading && Modal.hidePriLoading();
32 | // 在控制台打印接口及接口的返回结果
33 | console.log(options.url + " is failed!");
34 | console.log(res);
35 | }
36 | })
37 | }
38 |
39 | /**
40 | * 页面Loading显示、隐藏、弹框显示
41 | */
42 | var Modal = (function () {
43 |
44 | var priToast, // 显示弹框Toast
45 | priLoading, // 显示loading
46 | hidePriLoading; // 隐藏loading
47 |
48 | /**
49 | * 显示弹框
50 | * options 自定义配置参数
51 | */
52 | priToast = function (options) {
53 | // 调用api显示弹框
54 | wx.showToast({
55 | title: options.content,
56 | icon: options.type,
57 | duration: options.duration,
58 | mask: true
59 | })
60 | };
61 |
62 | /**
63 | * 显示loading
64 | */
65 | priLoading = function () {
66 | // 调用微信API显示loading
67 | wx.showLoading({
68 | title: "加载中...",
69 | mask: true
70 | });
71 | };
72 |
73 | /**
74 | * 隐藏loading
75 | */
76 | hidePriLoading = function () {
77 | // 调用微信API隐藏loading
78 | setTimeout(function () {
79 | wx.hideLoading()
80 | }, 1000)
81 | };
82 |
83 | return {
84 | priToast: priToast,
85 | priLoading: priLoading,
86 | hidePriLoading: hidePriLoading
87 | }
88 |
89 | })();
90 |
91 | /**
92 | * 页面跳转方法,分为跳转page、tabBar页面,返回上一级
93 | */
94 | var PageContent = (function () {
95 |
96 | var loadNavigate, // 跳转非tabBar页面
97 | goBack, // 返回上一级
98 | loadNavTabBar; // 跳转tabBar页面
99 |
100 | /**
101 | * 跳转非tabBar页面
102 | * @pram url 跳转路径
103 | */
104 | loadNavigate = function (url) {
105 | wx.navigateTo({
106 | url: url
107 | })
108 | };
109 |
110 | /**
111 | * 返回上一页
112 | * @pram delta 跳转层数
113 | */
114 | goBack = function (delta) {
115 | wx.navigateBack({
116 | delta: delta //返回的页面层数
117 | })
118 | };
119 |
120 | /**
121 | * 跳转tabBar页面
122 | * @pram url路径
123 | */
124 | loadNavTabBar = function (url) {
125 | wx.switchTab({
126 | url: url
127 | });
128 | };
129 |
130 | return {
131 | loadNavigate: loadNavigate,
132 | goBack: goBack,
133 | loadNavTabBar: loadNavTabBar
134 | }
135 |
136 | })();
137 |
138 | //暴露封装的方法
139 | module.exports = {
140 | http, // 全局通用请求数据方法
141 | Modal, // 页面交互提示
142 | PageContent // 页面跳转相关
143 | };
--------------------------------------------------------------------------------
/pages/index/get_coupons/get_coupons.wxss:
--------------------------------------------------------------------------------
1 | .title {
2 | width: 100%;
3 | height: 125rpx;
4 | border-top: 2rpx solid #E3E3E3;
5 | border-bottom: 2rpx solid #E3E3E3;
6 | background-color: white;
7 | text-align: center;
8 | }
9 |
10 | .title > text {
11 | display: block;
12 | margin-top: 20rpx;
13 | }
14 |
15 | .title > text:nth-child(1) {
16 | font-size: 28rpx;
17 | font-weight: 600;
18 | color: #363636;
19 | letter-spacing: 6rpx;
20 | }
21 |
22 | .title > text:nth-child(2) {
23 | font-size: 24rpx;
24 | font-weight: 400;
25 | color: #989898;
26 | letter-spacing: 2rpx;
27 | }
28 |
29 | .coupon_content {
30 | overflow: hidden;
31 | font-size: 24rpx;
32 | }
33 |
34 | .coupon_info {
35 | width: 644rpx;
36 | height: 132rpx;
37 | margin: 0 auto;
38 | margin-top: 20rpx;
39 | padding: 20rpx;
40 | background-size: cover;
41 | }
42 |
43 | .coupon_classification {
44 | width: 132rpx;
45 | height: 132rpx;
46 | float: left;
47 | }
48 |
49 | .coupon_classification > image {
50 | width: 100%;
51 | height: 100%;
52 | }
53 |
54 | .coupon_detail {
55 | width: 345rpx;
56 | float: left;
57 | margin-left: 20rpx;
58 | }
59 |
60 | .coupon_detail > view:nth-child(1) {
61 | line-height: 52rpx;
62 | }
63 |
64 | .discount_detail {
65 | margin-top: 36rpx;
66 | color: #74D2D4;
67 | }
68 |
69 | .discount_detail > text {
70 | display: inline-block;
71 | }
72 |
73 | .discount_detail > text:nth-child(1) {
74 | font-size: 32rpx;
75 | font-weight: 600;
76 | }
77 |
78 | .discount_detail > text:nth-child(2) {
79 | margin-left: 25rpx;
80 | }
81 |
82 | .get-coupon {
83 | width: 125rpx;
84 | height: 40rpx;
85 | float: right;
86 | color: white;
87 | text-align: right;
88 | line-height: 40rpx;
89 | margin-top: 44rpx;
90 | letter-spacing: 2rpx;
91 | }
92 |
93 | .to-use {
94 | width: 102rpx;
95 | height: 40rpx;
96 | float: right;
97 | color: white;
98 | text-align: right;
99 | line-height: 40rpx;
100 | margin-top: 44rpx;
101 | position: relative;
102 | }
103 |
104 | .to-use > text {
105 | display: inline-block;
106 | }
107 |
108 | .to-use > text:nth-child(1) {
109 | float: left;
110 | }
111 |
112 | .to-use > text:nth-child(2) {
113 | width: 24rpx;
114 | height: 24rpx;
115 | float: left;
116 | border: 1rpx solid white;
117 | border-radius: 50rpx;
118 | margin-top: 7rpx;
119 | margin-right: 3rpx;
120 | position: relative;
121 | }
122 |
123 | .circle:after {
124 | content: "";
125 | width: 9rpx;
126 | height: 9rpx;
127 | border: 1rpx solid white;
128 | border-right: 1rpx solid transparent;
129 | border-top: 1rpx solid transparent;
130 | transform: rotate(-45deg);
131 | position: absolute;
132 | top: 5rpx;
133 | right: 6rpx;
134 | }
135 |
136 | .coupon_goods_list {
137 | width: 100%;
138 | height: 495rpx;
139 | background-color: white;
140 | margin-top: 20rpx;
141 | position: relative;
142 | }
143 | .angle {
144 | border:15rpx solid white;
145 | border-left:15rpx solid transparent;
146 | border-right:15rpx solid transparent;
147 | border-top:15rpx solid transparent;
148 | position:absolute;
149 | top:-27rpx;
150 | left:95rpx;
151 | }
152 | .coupon-title {
153 | height: 80rpx;
154 | line-height: 80rpx;
155 | padding-left: 20rpx;
156 | }
157 | swiper {
158 | height: 415rpx;
159 | }
160 | .goods-content {
161 | width: 200rpx;
162 | display: inline-block;
163 | margin: 0 20rpx;
164 | }
165 | .goods-content > view {
166 | width: 100%;
167 | }
168 | .goods-content > view image {
169 | width: 100%;
170 | height: 220rpx;
171 | }
172 | .goods-description {
173 | height: 80rpx;
174 | line-height: 40rpx;
175 | }
176 | .money-detail {
177 | height: 50rpx;
178 | line-height: 50rpx;
179 | margin-top: 10rpx;
180 | color: #CC3C5D;
181 | }
182 |
183 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | page{
3 | background-color: #fff;
4 | }
5 | .header{
6 | padding-top:28rpx;
7 | display: flex;
8 | flex-direction: column;
9 | align-items: center;
10 | background-color: #c81624;
11 | color: #fff;
12 | }
13 | .logo01>image{
14 | width: 290rpx;
15 | height: 40rpx;
16 | }
17 | .motto{
18 | margin-top: 23rpx;
19 | }
20 | .motto>text{
21 | font-size:28rpx;
22 | }
23 | .search{
24 | margin:50rpx 0 18rpx 0;
25 | position: relative;
26 | }
27 | .search-static{
28 | position: absolute;
29 | left:232rpx;
30 | top:10rpx;
31 | z-index:2;
32 | }
33 |
34 | .search>input{
35 | color: #c6c6c6;
36 | width: 680rpx;
37 | height:40rpx;
38 | border-radius: 32rpx;
39 | background: #ffffff;
40 | font-size:24rpx;
41 | text-align: center;
42 | }
43 | .nav{
44 | display: flex;
45 | justify-content: space-around;
46 | font-size:24rpx;
47 | margin-top: 52rpx;
48 | }
49 | .nav>navigator view{
50 | display: flex;
51 | flex-direction: column;
52 | align-items: center;
53 | }
54 | .nav>navigator view text{
55 | margin:33rpx 0;
56 | }
57 | .nav-item1>image{
58 | width: 57rpx;
59 | height: 47rpx;
60 | }
61 | .nav-item2>image{
62 | width: 46rpx;
63 | height: 47rpx;
64 | }
65 | .nav-item3>image{
66 | width: 54rpx;
67 | height: 47rpx;
68 | }
69 | .nav-item4>image{
70 | width: 46rpx;
71 | height: 47rpx;
72 | }
73 | .section-bar{
74 | width:100%;
75 | height:18rpx;
76 | background: #e9e8ed;
77 | }
78 | .seckill{
79 | font-size: 34rpx;
80 | font-weight: 800;
81 | margin:27rpx 0;
82 | text-align: center;
83 | }
84 | .time{
85 | display: flex;
86 | justify-content: space-around;
87 | font-size: 24rpx;
88 | }
89 | .time>view text:nth-of-type(1){
90 | width: 110rpx;
91 | height: 66rpx;
92 | line-height: 66rpx;
93 | font-size:24rpx;
94 | text-align: center;
95 | }
96 | .time-active{
97 | width: 114rpx;
98 | height: 65rpx;
99 | color: #ffffff;
100 | background-color: #f35a5f;
101 | font-size:24rpx;
102 | border-radius: 32rpx;
103 | line-height: 65rpx;
104 | }
105 | .time-item{
106 | display: flex;
107 | flex-direction: column;
108 | align-items: center;
109 | }
110 | .time-item>text:nth-of-type(1){
111 | margin-bottom: 10rpx;
112 | }
113 | .count_down{
114 | font-size:28rpx;
115 | text-align: center;
116 | margin-top:32rpx;
117 | margin-bottom:45rpx;
118 | }
119 | .goods_item{
120 | display: flex;
121 | justify-content:space-around;
122 | color: #323232;
123 | }
124 | .goods_item01>image{
125 | width:214rpx;
126 | height:214rpx;
127 | }
128 | .goods_item01_pro{
129 | display: flex;
130 | flex-direction: column;
131 | margin-right:38rpx;
132 | width: 180px;
133 | }
134 | .goods_item01_pro>text{
135 | font-size:28rpx;
136 | }
137 | .item-description{
138 | text-overflow: -o-ellipsis-lastline;
139 | overflow: hidden;
140 | text-overflow: ellipsis;
141 | display: -webkit-box;
142 | -webkit-line-clamp: 2;
143 | -webkit-box-orient: vertical;
144 | }
145 | .now-price>text:nth-of-type(1){
146 | display: inline-block;
147 | color: #e77c89;
148 | font-size:26rpx;
149 | margin:8rpx 22rpx 0rpx 0;
150 | }
151 | .now-price{
152 | font-size: 30rpx;
153 | color: #f46366;
154 | }
155 | .now-price>text:nth-of-type(2){
156 | font-size:26rpx;
157 | text-decoration: line-through;
158 | color: #a2a2a2;
159 | }
160 | .percent{
161 | display: inline-block;
162 | font-size:26rpx;
163 | margin:0 16rpx 8rpx 0 ;
164 | color: #707070;
165 | }
166 | progress{
167 | display:inline-block;
168 | width:200rpx;
169 | }
170 | .immediately-btn text{
171 | display: inline-block;
172 | border-radius: 10rpx;
173 | width: 155rpx;
174 | height: 49rpx;
175 | line-height: 49rpx;
176 | font-size:28rpx;
177 | text-align: center;
178 | background: #f46366;
179 | color: #ffffff;
180 | padding:2rpx 8rpx;
181 | margin:0 22rpx 16rpx 0 ;
182 | }
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/pages/index/get_coupons/get_coupons.js:
--------------------------------------------------------------------------------
1 | const {http,PageContent} = require('../../../utils/util.js');
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | couponInfo: []
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function () {
15 | const that = this;
16 | // 调接口GetCoupon
17 | http({
18 | url: "GetCoupon",
19 | loading: true,
20 | func: function(data){
21 | that.setData({
22 | couponInfo: data
23 | });
24 | }
25 | });
26 | },
27 |
28 | /**
29 | * 点击领取优惠券
30 | */
31 | tapGetCoupon: function (e) {
32 | const that = this,
33 | coupon_info = this.data.couponInfo,
34 | new_coupon_info = coupon_info,
35 | coupon_id = e.currentTarget.id;
36 | // 调接口GetCurCoupon
37 | http({
38 | url: "GetCurCoupon",
39 | // 传入当前优惠券的id
40 | data: {"coupon_id": coupon_id},
41 | func: function(data){
42 | // 领取优惠券成功处理
43 | if (data.success == "1") {
44 | wx.showToast({
45 | title: "领取优惠券成功",
46 | success: function(res) {
47 | // 遍历coupon_info
48 | for (let i = 0;i < coupon_info.length; i++){
49 | // 找到当前点击的那条数据
50 | if (coupon_info[i]["coupon_id"] == coupon_id) {
51 | // 将当前数据的coupon_status置为1
52 | new_coupon_info[i]["coupon_status"] = "1";
53 | }
54 | }
55 | // 重新设置couponInfo数据
56 | that.setData({
57 | couponInfo: new_coupon_info
58 | })
59 | }
60 | })
61 | } else {
62 | // 领取优惠券失败处理
63 | }
64 | }
65 | });
66 | },
67 |
68 | /**
69 | * 点击当前所领取的优惠券
70 | */
71 | getCouponGoods: function (e) {
72 | const that = this,
73 | coupon_info = this.data.couponInfo,
74 | new_coupon_info = coupon_info,
75 | coupon_id = e.currentTarget.id;
76 | // 遍历coupon_info
77 | for (let i = 0;i < coupon_info.length; i++){
78 | // 找到当前点击的那条数据
79 | if (coupon_info[i]["coupon_id"] == coupon_id) {
80 | // 若当前优惠券没有商品列表则向后台请求商品列表
81 | if (!coupon_info[i].hasOwnProperty("goods_list")) {
82 | http({
83 | url: "GetCouponGoods",
84 | loading: true,
85 | // 传入当前优惠券的id
86 | data: {"coupon_id": coupon_id},
87 | func: function(data){
88 | // 将返回的商品列表放入new_coupon_info
89 | new_coupon_info[i]["goods_list"] = data["goods_list"];
90 | // 将当前数据的show_list取反
91 | new_coupon_info[i]["show_list"] = !new_coupon_info[i]["show_list"];
92 | // 重新设置couponInfo数据
93 | that.setData({
94 | couponInfo: new_coupon_info
95 | })
96 | }
97 | });
98 | } else {
99 | // 将当前数据的show_list取反
100 | new_coupon_info[i]["show_list"] = !new_coupon_info[i]["show_list"];
101 | // 重新设置couponInfo数据
102 | that.setData({
103 | couponInfo: new_coupon_info
104 | })
105 | }
106 | }
107 | }
108 | },
109 |
110 | /**
111 | * 点击链接到当前商品的详情页
112 | */
113 | toGoodsDetail: function (e) {
114 | PageContent.loadNavigate(`../../cart/goods_detail/goods_detail?goods_id=${e.currentTarget.id}`);
115 | },
116 |
117 | /**
118 | * 生命周期函数--监听页面初次渲染完成
119 | */
120 | onReady: function () {
121 |
122 | },
123 |
124 | /**
125 | * 生命周期函数--监听页面显示
126 | */
127 | onShow: function () {
128 |
129 | },
130 |
131 | /**
132 | * 生命周期函数--监听页面隐藏
133 | */
134 | onHide: function () {
135 |
136 | },
137 |
138 | /**
139 | * 生命周期函数--监听页面卸载
140 | */
141 | onUnload: function () {
142 |
143 | },
144 |
145 | /**
146 | * 页面相关事件处理函数--监听用户下拉动作
147 | */
148 | onPullDownRefresh: function () {
149 |
150 | },
151 |
152 | /**
153 | * 页面上拉触底事件的处理函数
154 | */
155 | onReachBottom: function () {
156 |
157 | },
158 |
159 | /**
160 | * 用户点击右上角分享
161 | */
162 | onShareAppMessage: function () {
163 |
164 | }
165 | })
--------------------------------------------------------------------------------
/pages/index/search_result/search_result.js:
--------------------------------------------------------------------------------
1 | // pages/index/search_result/search_result.js
2 | //获取应用实例,请求数据的方法
3 | const {
4 | http,
5 | PageContent
6 | } = require("../../../utils/util.js");
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 | normal_arrow: true, //价格灰色icon的显示
14 | arrow_selected: false, //价格红色icon的显示
15 | num: 2, //控制选中筛选的条件样式
16 | search_data: [], //页面加载用的数据
17 | input_value: "" //输入框显示的文本
18 | },
19 |
20 | /**
21 | * 生命周期函数--监听页面加载
22 | * @pram options--页面跳转带来的参数
23 | */
24 | onLoad: function (options) {
25 | const _this = this;
26 | //根据页面跳转带来的搜索条件发起请求
27 | http({
28 | url: "GetSearchResult",
29 | loading: true,
30 | data: {title: options.title}, //查询的具体商品
31 | //成功后处理
32 | func: (data) => {
33 | _this.setData({
34 | search_data: data["search_products"]
35 | })
36 | }
37 | });
38 | //输入框默认显示为页面跳转传递过来的数据
39 | this.setData({
40 | input_value: options.title
41 | })
42 | },
43 |
44 | /**
45 | * 筛选条件点击事件
46 | *@pram e--事件源自身携带的属性集合
47 | */
48 | changeFilterRules(e) {
49 | //根据查询条件重新渲染页面
50 | this.initPageByFilter(e.target.id);
51 | this.setData({
52 | num: e.target.dataset.num
53 | })
54 | },
55 |
56 | /**
57 | * 根据筛选条件渲染页面
58 | *@pram e--事件源自身携带的属性集合
59 | */
60 | initPageByFilter(search_type) {
61 | const _this = this;
62 | //根据页面选择的搜索条件进行处理
63 | switch (search_type) {
64 | //查询综合的商品信息
65 | case "comprehensive":
66 | http({
67 | url: "GetSearchRulesByComprehensive",
68 | data: {id: search_type},
69 | //成功后处理
70 | func: (data) => {
71 | _this.setData({
72 | search_data: data["search_products"]
73 | })
74 | }
75 | });
76 | break;
77 | //根据销量请求商品信息
78 | case "sales":
79 | http({
80 | url: "GetSearchRulesBySale",
81 | data: {id: search_type},
82 | func: (data) => {
83 | _this.setData({
84 | search_data: data["search_products"]
85 | })
86 | }
87 | });
88 | break;
89 | }
90 | },
91 |
92 | /**
93 | * 价格从最低到最高排列
94 | */
95 | lowToHighPrice() {
96 | const _this = this;
97 | //发起请求
98 | http({
99 | url: "GetPriceByLowToHigh",
100 | func: (data) => {
101 | _this.setData({
102 | search_data: data["search_products"],
103 | normal_arrow: false, //下箭头显示灰色
104 | arrow_selected: true //上箭头显示红色
105 | })
106 | }
107 | })
108 | },
109 |
110 | /**
111 | * 价格从最高到最低排列
112 | */
113 | HighToLowPrice() {
114 | const _this = this;
115 | //发起请求
116 | http({
117 | url: "GetSearchResult",
118 | func: (data) => {
119 | _this.setData({
120 | search_data: data["search_products"],
121 | normal_arrow: true, //上箭头显示灰色
122 | arrow_selected: false //下箭头显示红色
123 | })
124 | }
125 | })
126 | },
127 |
128 | /**
129 | * 点击筛选条件弹框
130 | */
131 | waitTodo() {
132 | wx.showToast({
133 | title: "暂时还没有做哦",
134 | icon: "loading",
135 | duration: 2000
136 | })
137 | },
138 |
139 | /**
140 | * 点击商品进入详情页
141 | */
142 | goDetail(e){
143 | PageContent.loadNavigate("../../cart/goods_detail/goods_detail");
144 | }
145 | });
--------------------------------------------------------------------------------
/pages/cart/goods_detail/goods_detail.js:
--------------------------------------------------------------------------------
1 | // pages/goods_detail/goods_detail.js
2 | const {
3 | http,PageContent
4 | } = require('../../../utils/util.js');
5 | Page({
6 |
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | swiper_attrs: {
12 | indicatorDots: true,
13 | autoplay: true,
14 | interval: 5000,
15 | duration: 1000,
16 | indicator_color: "#848689",
17 | indicator_active_color: "#f23030"
18 | },
19 | goods_detail: [],
20 | cart_num: 0,
21 | has_cart: false,
22 | total_num: 0,
23 | cart_arr: [],
24 | goods_id: "",
25 | default_num: 1
26 | },
27 |
28 | /**
29 | * 生命周期函数--监听页面加载
30 | */
31 | onLoad: function (options) {
32 | http({
33 | url: "GetGoodsDetail",
34 | data: options.product_id,
35 | func: (data) => {
36 | this.setData({
37 | goods_detail: data.goods_detail,
38 | goods_id: options.product_id
39 | });
40 | }
41 | });
42 | let arr = wx.getStorageSync('cart');
43 | let total_cart_count = 0;
44 | if (arr.length > 0) {
45 | for (let i in arr) {
46 | total_cart_count += parseInt(arr[i].count);
47 | }
48 | this.setData({
49 | has_cart: true,
50 | cart_num: total_cart_count,
51 | cart_arr: arr
52 | });
53 | }
54 |
55 | },
56 |
57 | minusCount: function (e) {
58 | let goods_detail = this.data.goods_detail;
59 | let num = parseInt(goods_detail.count);
60 | if (num <= 1) {
61 | return false;
62 | }
63 | num = num - 1;
64 | goods_detail.count = num;
65 | this.setData({
66 | goods_detail: goods_detail
67 | });
68 | },
69 | addCount: function (e) {
70 | let goods_detail = this.data.goods_detail;
71 | let num = parseInt(goods_detail.count);
72 | num = num + 1;
73 | goods_detail.count = num;
74 | this.setData({
75 | goods_detail: goods_detail
76 | });
77 | },
78 | getInputVal: function (e) {
79 | let goods_detail = this.data.goods_detail;
80 | let num = parseInt(e.detail.value);
81 | if (num == 0) {
82 | goods_detail.count = 1;
83 | } else {
84 | goods_detail.count = num;
85 | }
86 | this.setData({
87 | goods_detail: goods_detail
88 | });
89 | },
90 | addToCart: function (e) {
91 | let cart_num = this.data.cart_num;
92 | let cart_arr = this.data.cart_arr;
93 | this.setData({
94 | cart_num: cart_num + 1
95 | });
96 | this.data.goods_detail.count = 1;
97 | if (this.data.has_cart) {
98 | for (var i in cart_arr) {
99 | // 判断购物车内的item的id,和事件传递过来的id,是否相等
100 | if (cart_arr[i].id == this.data.goods_id) {
101 | // 相等的话,给count+1(即再次添加入购物车,数量+1)
102 | cart_arr[i].count = cart_arr[i].count + 1;
103 | // 最后,把购物车数据,存放入缓存(此处不用再给购物车数组push元素进去,因为这个是购物车有的,直接更新当前数组即可)
104 | try {
105 | wx.setStorageSync('cart', cart_arr)
106 | } catch (e) {
107 | console.log(e)
108 | }
109 | // 返回(在if内使用return,跳出循环节约运算,节约性能)
110 | return;
111 | }
112 | }
113 | // 遍历完购物车后,没有对应的item项,把当前项放入购物车数组
114 | cart_arr.push(this.data.goods_detail);
115 | } else {
116 | // 购物车没有数据,把item项push放入当前数据(第一次存放时)
117 | cart_arr.push(this.data.goods_detail);
118 | }
119 | // 最后,把购物车数据,存放入缓存
120 | try {
121 | wx.setStorageSync('cart', cart_arr)
122 | this.setData({
123 | has_cart: true
124 | });
125 | // 显示提示信息
126 | wx.showToast({
127 | title: '添加成功'
128 | });
129 | // 返回(在if内使用return,跳出循环节约运算,节约性能)
130 | return;
131 | } catch (e) {
132 | console.log(e);
133 | }
134 |
135 | },
136 | toCartPage: function (e) {
137 | PageContent.loadNavTabBar("../cart");
138 | }
139 | });
--------------------------------------------------------------------------------
/pages/cart/cart.wxss:
--------------------------------------------------------------------------------
1 | /* pages/cart/cart.wxss */
2 |
3 | /*page {
4 | background-color: #f0f2f5;
5 | }*/
6 |
7 | .my-container {
8 | border-top: 1rpx solid #e8e8e8;
9 | /*font-family: PingFangSC-Regular, Helvetica, "Droid Sans", Arial, sans-serif;
10 | font-size: 28rpx;*/
11 | }
12 |
13 | .jd-main-color {
14 | color: #f23030;
15 | }
16 |
17 | .margin-auto {
18 | margin: auto;
19 | }
20 |
21 | .fr {
22 | float: right;
23 | }
24 |
25 | .goods-wrap {
26 | background-color: #fff;
27 | padding-left: 20rpx;
28 | margin-bottom: 20rpx;
29 | }
30 |
31 | .shop-title {
32 | width: 100%;
33 | height: 85rpx;
34 | line-height: 85rpx;
35 | border-bottom: 1rpx solid #e8e8e8;
36 | display: flex;
37 | }
38 |
39 | .shop-select {
40 | margin-top: 20rpx;
41 | margin-right: 15rpx;
42 | }
43 |
44 | .shop-img {
45 | width: 32rpx;
46 | height: 26rpx;
47 | position: relative;
48 | top: 30rpx;
49 | }
50 |
51 | .shop-name {
52 | margin-left: 14rpx;
53 | font-size: 28rpx;
54 | }
55 |
56 | .special-offer {
57 | padding: 0 20rpx 30rpx 0;
58 | font-size: 24rpx;
59 | }
60 |
61 | .money-off {
62 | border: 1rpx solid #f23030;
63 | color: #f23030;
64 | font-size: 20rpx;
65 | margin-right: 15rpx;
66 | padding: 0 5rpx;
67 | border-radius: 2rpx;
68 | }
69 |
70 | .goods-list {
71 | border-bottom: 1rpx solid #e8e8e8;
72 | padding-top: 30rpx;
73 | }
74 |
75 | .goods-list:last-child {
76 | border-bottom: none;
77 | }
78 |
79 | .goods-detail-wrap {
80 | width: 100%;
81 | display: flex;
82 | justify-content: space-between;
83 | overflow: hidden;
84 | }
85 |
86 | .goods-detail {
87 | width: 100%;
88 | display: flex;
89 | flex-direction: row;
90 | padding-right: 20rpx;
91 | padding-bottom: 30rpx;
92 | -webkit-transition: all 0.4s;
93 | transition: all 0.4s;
94 | -webkit-transform: translateX(100rpx);
95 | transform: translateX(100rpx);
96 | margin-left: -100rpx;
97 | }
98 |
99 | .del {
100 | width: 100rpx;
101 | background-color: #f23030;
102 | color: #fff;
103 | display: flex;
104 | flex-direction: column;
105 | align-items: center;
106 | justify-content: center;
107 | -webkit-transform: translateX(100rpx);
108 | transform: translateX(100rpx);
109 | -webkit-transition: all 0.4s;
110 | transition: all 0.4s;
111 | }
112 |
113 | .touch-move-active .goods-detail, .touch-move-active .del {
114 | -webkit-transform: translateX(0);
115 | transform: translateX(0);
116 | }
117 |
118 | .goods-img image {
119 | width: 176rpx;
120 | height: 176rpx;
121 | margin: 0 14rpx;
122 | }
123 |
124 | .goods-descibe {
125 | width: 470rpx;
126 | height: auto;
127 | }
128 |
129 | .goods-describe-txt {
130 | font-size: 26rpx;
131 | line-height: 40rpx;
132 | overflow: hidden;
133 | text-overflow: ellipsis;
134 | display: -webkit-box;
135 | -webkit-line-clamp: 2;
136 | -webkit-box-orient: vertical;
137 | }
138 |
139 | .goods-spec {
140 | margin: 15rpx 0;
141 | color: #81838e;
142 | font-size: 22rpx;
143 | overflow: hidden;
144 | text-overflow: ellipsis;
145 | white-space: nowrap;
146 | }
147 |
148 | .goods-price {
149 | color: #f23030;
150 | font-size: 23rpx;
151 | height: 58rpx;
152 | line-height: 58rpx;
153 | }
154 |
155 | .goods-num {
156 | display: flex;
157 | height: 48rpx;
158 | line-height: 50rpx;
159 | border: 1rpx solid #b2b2b2;
160 | border-radius: 10rpx;
161 | text-align: center;
162 | float: right;
163 | }
164 |
165 | .subtract {
166 | width: 50rpx;
167 | border-right: 1rpx solid #b2b2b2;
168 | }
169 |
170 | .num {
171 | width: 68rpx;
172 | }
173 |
174 | .add {
175 | width: 50rpx;
176 | border-left: 1rpx solid #b2b2b2;
177 | }
178 |
179 | .cart-no-data {
180 | text-align: center;
181 | }
182 |
183 | .bottom-wrap {
184 | height: 95rpx;
185 | background-color: #fff;
186 | border-top: 1rpx solid #e0e0e0;
187 | padding-left: 20rpx;
188 | position: fixed;
189 | bottom: 0;
190 | display: flex;
191 | z-index: 100;
192 | }
193 |
194 | .choose-all {
195 | width: 50rpx;
196 | font-size: 24rpx;
197 | margin: auto 0;
198 | }
199 |
200 | .total-price-wrap {
201 | width: 440rpx;
202 | padding-right: 20rpx;
203 | text-align: right;
204 | margin: auto 0;
205 | line-height: 1.5em;
206 | }
207 |
208 | .total-txt {
209 | font-size: 26rpx;
210 | }
211 |
212 | .discount-price {
213 | color: #81838e;
214 | font-size: 24rpx;
215 | }
216 |
217 | .go-pay {
218 | width: 220rpx;
219 | line-height: 95rpx;
220 | font-size: 32rpx;
221 | text-align: center;
222 | background-color: #f23030;
223 | color: #fff;
224 | }
225 | .go-pay-disabled{
226 | background-color: #b2b2b2;
227 | }
--------------------------------------------------------------------------------
/pages/index/search_result/search_result.wxss:
--------------------------------------------------------------------------------
1 | /* pages/index/search_result/search_result.wxss */
2 |
3 | page {
4 | background-color: #fff;
5 | }
6 |
7 | .header {
8 | position: fixed;
9 | background-color: #fff;
10 | }
11 |
12 | .header-fill {
13 | width: 100%;
14 | height: 79.25px;
15 | }
16 |
17 | .search-title {
18 | margin: 0 20rpx;
19 | }
20 |
21 | .search-bar {
22 | display: flex;
23 | position: relative;
24 | margin-bottom: 14rpx;
25 | }
26 |
27 | .search {
28 | position: absolute;
29 | z-index: 2;
30 | left: 16rpx;
31 | top: 10rpx;
32 | }
33 |
34 | .cancel-icon {
35 | position: absolute;
36 | right: 150rpx;
37 | z-index: 2;
38 | top: 10rpx;
39 | }
40 |
41 | .search-bar>input {
42 | width: 650rpx;
43 | height: 60rxp;
44 | border-radius: 25rpx;
45 | background-color: #e9e8ee;
46 | padding-left: 60rpx;
47 | }
48 |
49 | .placeholder {
50 | font-size: 28rpx;
51 | color: #d6d6d9;
52 | }
53 |
54 | .cancel {
55 | width: 108rpx;
56 | height: 54rpx;
57 | font-size: 26rpx;
58 | line-height: 54rpx;
59 | }
60 |
61 | .search-btn {
62 | width: 108rpx;
63 | height: 54rpx;
64 | font-size: 26rpx;
65 | line-height: 54rpx;
66 | color: #fff;
67 | background-color: #f23030;
68 | }
69 |
70 | .content {
71 | border-top: 1rpx solid #e2e2e2;
72 | }
73 |
74 | .wrap-content {
75 | margin: 33rpx 20rpx 0 20rpx;
76 | }
77 |
78 | .content-title {
79 | margin-bottom: 29rpx;
80 | display: flex;
81 | justify-content: space-between;
82 | }
83 |
84 | .content-title text:nth-child(1) {
85 | font-size: 26rpx;
86 | color: #2d2d2d;
87 | font-weight: 700;
88 | }
89 |
90 | .content-title text:nth-child(2) {
91 | font-size: 22rpx;
92 | color: #b94358;
93 | margin-right: 22rpx;
94 | }
95 |
96 | .tags {
97 | font-size: 22rpx;
98 | display: flex;
99 | /*justify-content: space-around;*/
100 | flex-wrap: wrap;
101 | }
102 |
103 | .tags>text {
104 | padding: 10rpx 20rpx;
105 | background: #e9e8ee;
106 | margin-right: 14rpx;
107 | margin-bottom: 14rpx;
108 | }
109 |
110 | .bod-style {
111 | border-bottom: 1rpx solid #e9e8ee;
112 | text-indent: 10rpx;
113 | padding-bottom: 15rpx;
114 | }
115 |
116 | .nav-wrapper {
117 | display: flex;
118 | justify-content: space-around;
119 | padding: 26rpx 0 24rpx 0;
120 | font-size: 28rpx;
121 | border-top: 1rpx solid #e9e8ee;
122 | border-bottom: 1rpx solid #e9e8ee;
123 | }
124 |
125 | .filter>image {
126 | width: 25rpx;
127 | height: 26rpx;
128 | vertical-align: middle;
129 | padding-bottom: 2rpx;
130 | }
131 |
132 | .left-image>image {
133 | width: 224rpx;
134 | height: 241rpx;
135 | }
136 |
137 | .result_item {
138 | margin-top: 10rpx;
139 | display: flex;
140 | justify-content: space-between;
141 | }
142 |
143 | .right-production {
144 | width: 450rpx;
145 | border-bottom: 1rpx solid #e9e8ee;
146 | padding-right: 20rpx;
147 | margin-top: 30rpx;
148 | }
149 |
150 | .item-title {
151 | text-overflow: -o-ellipsis-lastline;
152 | overflow: hidden;
153 | text-overflow: ellipsis;
154 | display: -webkit-box;
155 | -webkit-line-clamp: 2;
156 | -webkit-box-orient: vertical;
157 | font-size: 26rpx;
158 | }
159 |
160 | .price {
161 | font-size: 20rpx;
162 | margin: 34rpx 0 20rpx 0;
163 | }
164 |
165 | .price>text {
166 | font-size: 28rpx;
167 | }
168 |
169 | .comment {
170 | font-size: 24rpx;
171 | color: #aaa;
172 | }
173 |
174 | .comment>text {
175 | margin-right: 10rpx;
176 | }
177 |
178 | .selected {
179 | color: #f23030;
180 | font-weight: 700;
181 | }
182 |
183 | .nav-price {
184 | position: relative;
185 | }
186 |
187 | .top-arrow {
188 | position: absolute;
189 | width: 0;
190 | height: 0;
191 | border-left: 10rpx solid transparent;
192 | border-right: 10rpx solid transparent;
193 | border-top: 12rpx solid #c7cfcc;
194 | top: 20rpx;
195 | right: -18px;
196 | }
197 | .top-arrow-slected{
198 | position: absolute;
199 | width: 0;
200 | height: 0;
201 | border-left: 10rpx solid transparent;
202 | border-right: 10rpx solid transparent;
203 | border-top: 12rpx solid #f23030;
204 | top: 20rpx;
205 | right: -34rpx;
206 | }
207 | .bottom-arrow {
208 | position: absolute;
209 | width: 0;
210 | height: 0;
211 | border-left: 10rpx solid transparent;
212 | border-right: 10rpx solid transparent;
213 | border-bottom: 12rpx solid #c7cfcc;
214 | top: 6rpx;
215 | right: -34rpx;
216 | }
217 | .bottom-arrow-selected{
218 | position: absolute;
219 | width: 0;
220 | height: 0;
221 | border-left: 10rpx solid transparent;
222 | border-right: 10rpx solid transparent;
223 | border-bottom: 12rpx solid #f23030;
224 | top: 6rpx;
225 | right: -34rpx;
226 | }
--------------------------------------------------------------------------------
/pages/index/search/search.js:
--------------------------------------------------------------------------------
1 | // pages/index/search/search.js
2 | //获取应用实例,请求数据的方法
3 | const {
4 | http,
5 | PageContent
6 | } = require("../../../utils/util.js");
7 | Page({
8 |
9 | /**
10 | * 页面的初始数据
11 | */
12 | data: {
13 | active_search_val: "", //实时搜索显示
14 | active_search: true, //实时搜索推荐
15 | search_show_status: false, //控制热搜和历史搜索显示
16 | history_show: false, //控制历史搜索显示隐藏
17 | btnsearch_status: true, //控制显示隐藏搜索按钮
18 | btncancel_status: false, //控制显示隐藏取消按钮
19 | cancel_icon: true, //searchbar关闭按钮的显示
20 | input_value: "", //初始化输入框为空
21 | hot_search: [], //热门搜索的数据
22 | history_search: [] //历史搜索的数据
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面加载
27 | * @pram options--页面跳转带来的参数
28 | */
29 | onLoad: function (options) {
30 | //保存this对象
31 | const _this = this;
32 | //请求热搜数据
33 | http({
34 | url: "GetSearch",
35 | loading: true,
36 | func: (data) => {
37 | // 成功后加载页面
38 | _this.initPage(data);
39 | }
40 | })
41 | },
42 |
43 | /**
44 | * input输入内容时cancel按钮的显示隐藏
45 | * @pram e 当前点击对象的属性集合
46 | */
47 | inputShow(e) {
48 | //输入值时
49 | if (e.detail.value) {
50 | this.setData({
51 | active_search_val: e.detail.value, //当前下拉显示的实时搜索功能
52 | active_search: false, //显示实时搜索的结果
53 | search_show_status: true, //隐藏页面历史搜索和热门搜索
54 | btncancel_status: true, //隐藏取消按钮
55 | btnsearch_status: false, //显示搜索按钮
56 | cancel_icon: false, //显示关闭按钮
57 | input_value: e.detail.value //设置输入框的值为当前输入的值
58 | })
59 | } else {
60 | this.setData({
61 | active_search: true, //隐藏实时搜索的结果
62 | search_show_status: false, //隐藏页面历史搜索和热门搜索
63 | btncancel_status: false, //显示取消按钮
64 | btnsearch_status: true, //隐藏搜索按钮
65 | cancel_icon: true, //隐藏关闭按钮
66 | input_value: "" //输入框的值为空
67 | })
68 | }
69 | },
70 |
71 | /**
72 | * 点击清除隐藏历史搜索
73 | */
74 | clearHistorySearch() {
75 | this.setData({
76 | history_show: true
77 | });
78 | //发起清除历史记录的请求
79 | http({
80 | url: "SetClearHistory",
81 | data: this.data.history_search,
82 | func: (data) => {
83 | //成功后弹窗提示
84 | wx.showToast({
85 | title: "清除成功",
86 | icon: "success", //icon的类型
87 | duration: 2000 //弹窗持续时长
88 | })
89 | }
90 | })
91 | },
92 |
93 | /**
94 | * 搜索按钮点击事件
95 | */
96 | searchGoods() {
97 | PageContent.loadNavigate(`../search_result/search_result?title=${this.data.active_search_val}`);
98 | },
99 |
100 | /**
101 | * input输入内容时cancel按钮的显示隐藏
102 | * @pram e--当前点击对象的属性集合
103 | */
104 | clearInput(e) {
105 | this.setData({
106 | active_search: true,
107 | cancel_icon: true,
108 | input_value: "",
109 | search_show_status: false, //隐藏页面历史搜索和热门搜索
110 | btncancel_status: false, //显示取消按钮
111 | btnsearch_status: true //隐藏搜索按钮
112 | })
113 | },
114 |
115 | /**
116 | * 点击取消返回上一级
117 | */
118 | getBack() {
119 | // 返回上一级
120 | PageContent.goBack(1);
121 | },
122 |
123 | /**
124 | * 初始化页面
125 | * @pram data--页面加载的数据
126 | */
127 | initPage: function (data) {
128 | this.setData({
129 | hot_search: data["hot_search"], //赋值请求到的值给当前page下面的data.hot_search
130 | history_search: data["history_search"] //赋值请求到的值给当前page下面的data.history_search
131 | });
132 | },
133 |
134 | /**
135 | * 换一批点击事件
136 | */
137 | changeHotItems: function () {
138 | //保存this对象
139 | const _this = this;
140 | //请求数据
141 | http({
142 | url: "GetChangeHotSearch",
143 | loading: true,
144 | func: (data) => {
145 | // 成功后加载页面
146 | _this.initPage(data);
147 | }
148 | })
149 | },
150 |
151 | /**
152 | * 点击热门搜索或历史搜索字段时自动填充到搜索框
153 | * @pram e--当前点击对象的属性集合
154 | */
155 | fillInputValue(e) {
156 | this.setData({
157 | active_search_val: e.target.dataset.cur_value, //设置当前搜索字段值为选中的字段值
158 | input_value: e.target.dataset.cur_value, //设置选中的字段值在输入框中
159 | btncancel_status: true, //隐藏取消按钮
160 | btnsearch_status: false, //显示搜索按钮
161 | cancel_icon: false //显示关闭按钮
162 | })
163 | }
164 | });
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 领优惠券
25 |
26 |
27 |
28 |
29 |
30 | 扫码购物
31 |
32 |
33 |
34 |
35 |
36 | 物流查询
37 |
38 |
39 |
40 |
41 |
42 | 商品分类
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | 京东秒杀
52 |
53 |
54 |
55 | 14:00
56 | 抢购中
57 |
58 |
59 | 16:00
60 | 即将开始
61 |
62 |
63 | 18:00
64 | 即将开始
65 |
66 |
67 | 20:00
68 | 即将开始
69 |
70 |
71 | 22:00
72 | 即将开始
73 |
74 |
75 |
76 | 距本场结束
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | {{item.description}}
89 | {{item.product_name}}
90 |
91 | ¥
92 | {{item.now_price}}
93 | ¥{{item.old_price}}
94 |
95 |
96 | 已售 {{item.sold}}
97 |
98 |
99 |
100 |
101 | 立即抢购
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
134 |
--------------------------------------------------------------------------------
/pages/cart/goods_detail/goods_detail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | ¥
13 | {{goods_detail.new_price}}
14 | .00
15 |
16 |
17 | ¥{{goods_detail.old_price}}
18 | 京东秒杀
19 |
20 |
21 |
22 | 距结束还剩
23 | 22:15:01
24 |
25 |
26 |
27 | {{goods_detail.describe}}
28 |
29 |
30 |
31 |
32 |
33 |
34 | 促销
35 | 订单享受促销以确认订单页展示为准
36 |
37 |
38 |
39 |
40 | 限购
41 | 购买1-10件时享受优惠,超出数量以结算件为准
42 |
43 |
44 | 限制
45 | 此价格不与套装优惠同时享受
46 |
47 |
48 | 满减
49 | 每满116元,可减8元现金
50 |
51 |
52 |
53 |
54 |
55 | 已选
56 | {{goods_detail.default_type}},
57 | {{goods_detail.count}}个
58 |
59 |
60 |
61 |
62 |
63 | 颜色
64 |
65 |
66 | {{item}}
67 |
68 |
69 |
70 |
71 | 数量
72 |
73 |
74 | -
75 |
76 |
77 |
78 | +
79 |
80 |
81 |
82 |
83 |
84 |
85 | 地址
86 | 广东省
87 | 深圳市
88 | 宝安区
89 |
90 |
91 |
92 |
93 | [现货]18:00前下单,预计 明天(09月07日)送达
94 |
95 | 重量不计重量
96 |
97 |
98 |
99 |
100 | 商家发货&售后
101 |
102 |
103 | 七天退货
104 |
105 |
106 | 货到付款
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 | 爱立歌旗舰店
117 |
118 |
157 |
158 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 | 购物车
181 | {{cart_num}}
182 |
183 |
184 |
185 | 加入购物车
186 | 立即购买
187 |
--------------------------------------------------------------------------------
/pages/cart/goods_detail/goods_detail.wxss:
--------------------------------------------------------------------------------
1 | /* pages/goods_detail/goods_detail.wxss */
2 |
3 | page {
4 | border-top: 1rpx solid #ededed;
5 | }
6 |
7 | .no-padding-bottom {
8 | padding-bottom: 0 !important;
9 | }
10 |
11 | .no-padding-top {
12 | padding-top: 0 !important;
13 | }
14 |
15 | .margin-0 {
16 | margin: 0 !important;
17 | }
18 |
19 | .margin-bottom-20 {
20 | margin-bottom: 20rpx !important;
21 | }
22 |
23 | swiper {
24 | width: 100%;
25 | height: 736rpx;
26 | }
27 |
28 | .slide-image {
29 | width: 100%;
30 | height: 100%;
31 | }
32 |
33 | .goods-price {
34 | width: 100%;
35 | height: 100rpx;
36 | background-color: #fff;
37 | display: flex;
38 | }
39 |
40 | .price-wrap {
41 | width: 506rpx;
42 | color: #fff;
43 | background-color: #ec4c56;
44 | display: flex;
45 | }
46 |
47 | .new-price {
48 | padding: 0 20rpx;
49 | line-height: 100rpx;
50 | }
51 |
52 | .old-price {
53 | margin-top: 20rpx;
54 | text-decoration: line-through;
55 | }
56 |
57 | .count-down {
58 | width: 244rpx;
59 | text-align: center;
60 | }
61 |
62 | .count-down .color-grey {
63 | display: block;
64 | margin-top: 10rpx;
65 | }
66 |
67 | .goods-describe {
68 | padding: 20rpx 20rpx 30rpx 20rpx;
69 | line-height: 1.5em;
70 | background-color: #fff;
71 | margin-bottom: 20rpx;
72 | }
73 |
74 | .accordion-group {
75 | background-color: #fff;
76 | margin-bottom: 20rpx;
77 | padding-left: 20rpx;
78 | }
79 |
80 | .accordion-heading {
81 | height: 80rpx;
82 | line-height: 80rpx;
83 | padding-right: 20rpx;
84 | }
85 |
86 | .icon {
87 | display: block;
88 | background-image: url(https://st.360buyimg.com/item/images/5.4/product-detail-sprites-mjs.png?v=1);
89 | background-repeat: no-repeat;
90 | background-size: 200rpx 200rpx;
91 | }
92 |
93 | .arrow-up {
94 | background-position: 0 -20rpx;
95 | width: 20rpx;
96 | height: 20rpx;
97 | position: relative;
98 | top: 36rpx;
99 | }
100 |
101 | .arrow-right {
102 | width: 10rpx;
103 | height: 20rpx;
104 | background-position: 0 -40rpx;
105 | position: relative;
106 | top: 10rpx;
107 | }
108 |
109 | .accordion-heading {
110 | border-bottom: 1px solid #f4f4f4;
111 | }
112 |
113 | .sale-title {
114 | margin-right: 20rpx;
115 | }
116 |
117 | .sale-item {
118 | height: 80rpx;
119 | line-height: 80rpx;
120 | border-bottom: 1px solid #f4f4f4;
121 | }
122 |
123 | .sale-tag {
124 | border: 1px solid #f23030;
125 | border-radius: 5rpx;
126 | padding: 0 5rpx;
127 | color: #f23030;
128 | font-size: 24rpx;
129 | margin-right: 10rpx;
130 | }
131 |
132 | .goods-color {
133 | display: block;
134 | float: left;
135 | background-color: #f3f2f8;
136 | padding: 15rpx 20rpx;
137 | margin-right: 24rpx;
138 | border-radius: 10rpx;
139 | margin-bottom: 20rpx;
140 | }
141 |
142 | .goods-color-picked {
143 | background-color: #f23030;
144 | color: #fff;
145 | }
146 |
147 | .picked-item {
148 | display: flex;
149 | padding: 30rpx 0;
150 | }
151 |
152 | .left {
153 | width: 10%;
154 | font-size: 24rpx;
155 | color: #848689;
156 | padding-top: 15rpx;
157 | }
158 | .right{
159 | width: 90%;
160 | }
161 | .num-wrap {
162 | display: flex;
163 | border: 1rpx solid #bebebe;
164 | border-radius: 10rpx;
165 | }
166 |
167 | .minus, .add {
168 | width: 60rpx;
169 | height: 60rpx;
170 | line-height: 60rpx;
171 | text-align: center;
172 | }
173 |
174 | .minus {
175 | border-right: 1rpx solid #bebebe;
176 | }
177 |
178 | .add {
179 | border-left: 1rpx solid #bebebe;
180 | }
181 |
182 | .input-num {
183 | width: 90rpx;
184 | text-align: center;
185 | font-size: 36rpx;
186 | }
187 |
188 | .input-num input {
189 | height: 100%;
190 | }
191 |
192 | .address {
193 | background-color: #fff;
194 | padding: 0 20rpx;
195 | margin-bottom: 20rpx;
196 | }
197 |
198 | .addr-item {
199 | border-bottom: 1px solid #f4f4f4;
200 | padding: 20rpx 0;
201 | }
202 |
203 | .choose-addr text {
204 | margin-right: 20rpx;
205 | }
206 |
207 | .service-type {
208 | margin-right: 20rpx;
209 | margin-bottom: 10rpx;
210 | display: inline-block;
211 | }
212 |
213 | .customer-service {
214 | display: flex;
215 | }
216 |
217 | .service {
218 | width: 80%;
219 | }
220 |
221 | .icon-arrow-right {
222 | width: 20%;
223 | text-align: right;
224 | }
225 |
226 | .service-type .icon-check {
227 | position: relative;
228 | top: 8rpx;
229 | }
230 |
231 | .shop-info {
232 | background: #fff;
233 | margin-bottom: 20rpx;
234 | padding: 20rpx;
235 | }
236 |
237 | .shop-logo {
238 | width: 260rpx;
239 | height: 88rpx;
240 | margin-right: 20rpx;
241 | position: relative;
242 | top: 10rpx;
243 | }
244 |
245 | .shop-name {
246 | position: relative;
247 | top: -20rpx;
248 | }
249 |
250 | .comments {
251 | background: #fff;
252 | padding: 20rpx;
253 | margin-bottom: 20rpx;
254 | }
255 |
256 | .comment-title {
257 | padding-bottom: 20rpx;
258 | border-bottom: 1rpx solid #f4f4f4;
259 | }
260 |
261 | .comment-list {
262 | border-bottom: 1rpx solid #f4f4f4;
263 | }
264 |
265 | .user-account {
266 | padding: 20rpx 0;
267 | }
268 |
269 | .comment-txt {
270 | padding: 20rpx 0;
271 | }
272 |
273 | .user-info {
274 | padding: 20rpx 0;
275 | }
276 |
277 | .comment-bottom {
278 | padding-top: 20rpx;
279 | font-size: 24rpx;
280 | }
281 |
282 | .comment-bottom .arrow-right {
283 | top: 6rpx;
284 | }
285 |
286 | .more {
287 | margin-right: 10rpx;
288 | }
289 |
290 | .pic-wrap {
291 | display: inline-block;
292 | margin-right: 10rpx;
293 | position: relative;
294 | }
295 |
296 | .pic {
297 | width: 160rpx;
298 | height: 160rpx;
299 | }
300 |
301 | .more-pic {
302 | width: 160rpx;
303 | height: 160rpx;
304 | line-height: 160rpx;
305 | position: absolute;
306 | bottom: 0;
307 | top: 0;
308 | background-color: rgba(0, 0, 0, 0.6);
309 | color: #fff;
310 | text-align: center;
311 | }
312 |
313 | .comment-txt {
314 | line-height: 1.5em;
315 | }
316 |
317 | .user-account text {
318 | margin-right: 20rpx;
319 | }
320 |
321 | .user-info text {
322 | margin-right: 10rpx;
323 | font-size: 24rpx;
324 | color: #848689;
325 | }
326 |
327 | .goods-detail {
328 | background-color: #fff;
329 | padding-bottom: 95rpx;
330 | }
331 |
332 | .menu {
333 | display: flex;
334 | border-bottom: 1rpx solid #f4f4f4;
335 | }
336 |
337 | .menu-list {
338 | width: 33.33%;
339 | height: 80rpx;
340 | line-height: 80rpx;
341 | text-align: center;
342 | position: relative;
343 | }
344 |
345 | .menu-line {
346 | display: block;
347 | width: 100%;
348 | height: 4rpx;
349 | }
350 |
351 | .cur-menu {
352 | color: #f23030;
353 | }
354 |
355 | .cur-menu .menu-line {
356 | background-color: #f23030;
357 | }
358 |
359 | .detail-content {
360 | padding-top: 20rpx;
361 | }
362 |
363 | .pic-detail {
364 | width: 100%;
365 | /*height: auto;*/
366 | }
367 |
368 | .bottom {
369 | position: fixed;
370 | bottom: 0;
371 | display: flex;
372 | height: 95rpx;
373 | width: 100%;
374 | background-color: #fff;
375 | text-align: center;
376 | z-index: 10;
377 | color: #fff;
378 | }
379 |
380 | .cart {
381 | width: 20%;
382 | }
383 |
384 | .add-cart {
385 | width: 40%;
386 | line-height: 95rpx;
387 | background-color: #ff9600;
388 | }
389 |
390 | .go-pay {
391 | width: 40%;
392 | line-height: 95rpx;
393 | background-color: #f23030;
394 | }
395 |
396 | .dot {
397 | display: block;
398 | position: absolute;
399 | bottom: 0;
400 | top: 0;
401 | right: 0;
402 | margin-right: 10rpx;
403 | margin-top: -10rpx;
404 | width: 30rpx;
405 | height: 30rpx;
406 | line-height: 30rpx;
407 | color: #fff;
408 | text-align: center;
409 | background-color: #f23030;
410 | border-radius: 50%;
411 | }
412 |
413 | .cart-txt {
414 | display: block;
415 | margin-top: 35rpx;
416 | position: relative;
417 | }
418 |
--------------------------------------------------------------------------------
/pages/cart/cart.js:
--------------------------------------------------------------------------------
1 | // pages/cart/cart.js
2 | const {
3 | http,
4 | PageContent
5 | } = require('../../utils/util.js');
6 | Page({
7 | /**
8 | * 页面的初始数据
9 | */
10 | data: {
11 | cart: [], // 购物车商品列表
12 | has_list: false, // 购物车是否有数据
13 | total_price: 0, // 总价,初始为0
14 | select_all_status: true, // 全选状态,默认全选
15 | startX: 0, // 开始坐标X
16 | startY: 0, // 开始坐标Y
17 | shop_select_status: true, // 商店选择状态
18 | discount_price: 0, // 优惠价格
19 | total_num: 0 // 选择商品总数
20 | },
21 | /**
22 | * 生命周期函数--监听页面加载
23 | */
24 | onLoad: function (options) {
25 | this.getCartData();
26 | this.getTotalPrice();
27 | },
28 | onShow: function () {
29 | this.getCartData();
30 | this.getTotalPrice();
31 | },
32 | /**
33 | * 自定义方法
34 | */
35 | getCartData: function () {
36 | let cart = wx.getStorageSync('cart');
37 | if (cart.length != 0) {
38 | this.setData({
39 | has_list: true,
40 | cart: cart
41 | });
42 | }
43 | },
44 | // 手指触摸动作开始 记录起点X坐标
45 | touchstart(e) {
46 | // 开始触摸时 重置所有删除
47 | this.data.cart.forEach(function (v, i) {
48 | if (v.is_touch_move) // 只操作为true的
49 | v.is_touch_move = false;
50 | });
51 | this.setData({
52 | startX: e.changedTouches[0].clientX,
53 | startY: e.changedTouches[0].clientY,
54 | cart: this.data.cart
55 | })
56 | },
57 |
58 | // 滑动事件处理
59 | touchmove(e) {
60 | var that = this,
61 | index = e.currentTarget.dataset.index, // 当前索引
62 | startX = that.data.startX, // 开始X坐标
63 | startY = that.data.startY, // 开始Y坐标
64 | touchMoveX = e.changedTouches[0].clientX, // 滑动变化坐标
65 | touchMoveY = e.changedTouches[0].clientY, // 滑动变化坐标
66 | // 获取滑动角度
67 | angle = that.angle({X: startX, Y: startY}, {X: touchMoveX, Y: touchMoveY});
68 | that.data.cart.forEach(function (v, i) {
69 | v.is_touch_move = false;
70 | // 滑动超过30度角 return
71 | if (Math.abs(angle) > 30) return;
72 | if (i == index) {
73 | if (touchMoveX > startX) // 右滑
74 | v.is_touch_move = false
75 | else // 左滑
76 | v.is_touch_move = true
77 | }
78 | });
79 | this.setData({
80 | cart: this.data.cart
81 | })
82 | },
83 |
84 | /**
85 | * 计算滑动角度
86 | * @param {Object} start 起点坐标
87 | * @param {Object} end 终点坐标
88 | */
89 | angle(start, end) {
90 | var _X = end.X - start.X,
91 | _Y = end.Y - start.Y
92 | //返回角度 /Math.atan()返回数字的反正切值
93 | return 360 * Math.atan(_Y / _X) / (2 * Math.PI);
94 | },
95 | // 获取手动输入数量的值
96 | getInputVal(e) {
97 | const index = e.currentTarget.dataset.index;
98 | let carts = this.data.cart;
99 | let num = parseInt(e.detail.value);
100 | if (num == 0) {
101 | carts[index].count = 1;
102 | } else {
103 | carts[index].count = num;
104 | }
105 | this.setData({
106 | cart: carts
107 | });
108 | try {
109 | wx.setStorageSync('cart', carts)
110 | } catch (e) {
111 | console.log(e)
112 | }
113 | this.getTotalPrice();
114 | },
115 | // 计算总额
116 | getTotalPrice() {
117 | let carts = this.data.cart; // 获取购物车列表
118 | let total_price = 0;
119 | let total_num = 0;
120 | for (let i = 0; i < carts.length; i++) { // 循环列表得到每个数据
121 | if (carts[i].is_selected) { // 判断选中才会计算价格
122 | total_num += parseInt(carts[i].count); // 所有商品总数
123 | total_price += carts[i].count * parseFloat(carts[i].new_price); // 所有价格加起来
124 | }
125 | }
126 | this.setData({ // 最后赋值到data中渲染到页面
127 | cart: carts,
128 | total_price: total_price.toFixed(2),
129 | total_num: total_num
130 | });
131 | },
132 |
133 | // 选择商品
134 | selectList(e) {
135 | const index = e.currentTarget.dataset.index; // 获取data- 传进来的index
136 | let carts = this.data.cart; // 获取购物车列表
137 | const selected = carts[index].is_selected; // 获取当前商品的选中状态
138 | carts[index].is_selected = !selected; // 改变状态
139 | if (!selected == false) {
140 | this.setData({
141 | shop_select_status: false,
142 | select_all_status: false
143 | });
144 | }
145 | let selected_arr = [];
146 | for (let i = 0; i < carts.length; i++) {
147 | if (carts[i].is_selected == true) {
148 | selected_arr.push(carts[i]);
149 | }
150 | }
151 | if (selected_arr.length == carts.length) { // 判断当前商店中的商品是否都选中
152 | this.setData({
153 | shop_select_status: true,
154 | select_all_status: true
155 | });
156 | }
157 | this.setData({
158 | cart: carts
159 | });
160 | this.getTotalPrice(); // 重新获取总价
161 | },
162 |
163 | // 全选
164 | selectAll: function (e) {
165 | let selectAllStatus = this.data.select_all_status; // 是否全选状态
166 | selectAllStatus = !selectAllStatus;
167 | let carts = this.data.cart;
168 |
169 | for (let i = 0; i < carts.length; i++) {
170 | carts[i].is_selected = selectAllStatus; // 改变所有商品状态
171 | }
172 | this.setData({
173 | select_all_status: selectAllStatus,
174 | shop_select_status: selectAllStatus,
175 | cart: carts
176 | });
177 | this.getTotalPrice(); // 重新获取总价
178 | },
179 |
180 | /**
181 | * 绑定加数量事件
182 | */
183 | addCount(e) {
184 | const index = e.currentTarget.dataset.index;
185 | let carts = this.data.cart;
186 | let num = parseInt(carts[index].count);
187 | num = num + 1;
188 | carts[index].count = num;
189 | this.setData({
190 | cart: carts
191 | });
192 | try {
193 | wx.setStorageSync('cart', carts)
194 | } catch (e) {
195 | console.log(e)
196 | }
197 | this.getTotalPrice();
198 | },
199 |
200 | /**
201 | * 绑定减数量事件
202 | */
203 | minusCount(e) {
204 | const index = e.currentTarget.dataset.index;
205 | let carts = this.data.cart;
206 | let num = parseInt(carts[index].count);
207 | if (num <= 1) {
208 | return false;
209 | }
210 | num = num - 1;
211 | carts[index].count = num;
212 | this.setData({
213 | cart: carts
214 | });
215 | try {
216 | wx.setStorageSync('cart', carts)
217 | } catch (e) {
218 | console.log(e)
219 | }
220 | this.getTotalPrice();
221 | },
222 |
223 | // 选择商店里的所有商品
224 | shopSelectAll() {
225 | let shop_select_status = this.data.shop_select_status;
226 | shop_select_status = !shop_select_status;
227 | let carts = this.data.cart;
228 |
229 | for (let i = 0; i < carts.length; i++) {
230 | carts[i].is_selected = shop_select_status; // 改变所有商品状态
231 | }
232 | this.setData({
233 | select_all_status: shop_select_status,
234 | shop_select_status: shop_select_status,
235 | cart: carts
236 | });
237 | this.getTotalPrice();
238 | },
239 |
240 | // 删除商品列表
241 | delGoods(e) {
242 | var that = this;
243 | wx.showModal({
244 | content: '是否确认删除此商品?',
245 | success: function (res) {
246 | if (res.confirm) {
247 | const index = e.currentTarget.dataset.index;
248 | let carts = that.data.cart;
249 | carts.splice(index, 1);
250 | that.setData({
251 | cart: carts
252 | });
253 | try {
254 | wx.setStorageSync('cart', carts)
255 | } catch (e) {
256 | console.log(e)
257 | }
258 | if (!carts.length) {
259 | that.setData({
260 | has_list: false
261 | });
262 | }
263 | that.getTotalPrice();
264 | }
265 | }
266 | })
267 | },
268 | goDetail(e) {
269 | PageContent.loadNavigate(`goods_detail/goods_detail?product_id=${e.currentTarget.dataset.id}`);
270 | }
271 | });
--------------------------------------------------------------------------------
/test/GetClassification:
--------------------------------------------------------------------------------
1 | {
2 | "cate_items": [
3 | {
4 | "cate_id": "1",
5 | "cate_name": "秋季潮流",
6 | "children": [
7 | {
8 | "child_id": "1",
9 | "name": "红色卫衣",
10 | "image": "../../../images/index/product05.png"
11 | },
12 | {
13 | "child_id": "2",
14 | "name": "潮流卫衣",
15 | "image": "../../../images/index/product04.png"
16 | },
17 | {
18 | "child_id": "3",
19 | "name": "超人卫衣",
20 | "image": "../../../images/index/product03.png"
21 | },
22 | {
23 | "child_id": "1",
24 | "name": "红色卫衣",
25 | "image": "../../../images/index/product02.png"
26 | },
27 | {
28 | "child_id": "2",
29 | "name": "潮流卫衣",
30 | "image": "../../../images/index/product01.png"
31 | },
32 | {
33 | "child_id": "3",
34 | "name": "超人卫衣",
35 | "image": "../../../images/index/product05.png"
36 | },
37 | {
38 | "child_id": "1",
39 | "name": "红色卫衣",
40 | "image": "../../../images/index/product01.png"
41 | },
42 | {
43 | "child_id": "2",
44 | "name": "潮流卫衣",
45 | "image": "../../../images/index/product02.png"
46 | },
47 | {
48 | "child_id": "3",
49 | "name": "超人卫衣",
50 | "image": "../../../images/index/product03.png"
51 | },
52 | {
53 | "child_id": "4",
54 | "name": "红色卫衣",
55 | "image": "../../../images/index/product04.png"
56 | },
57 | {
58 | "child_id": "5",
59 | "name": "高仿卫衣",
60 | "image": "../../../images/index/product01.png"
61 | },
62 | {
63 | "child_id": "6",
64 | "name": "西西卫衣",
65 | "image": "../../../images/index/product04.png"
66 | }
67 | ]
68 | },
69 | {
70 | "cate_id": "2",
71 | "cate_name": "时尚搭配",
72 | "children": [
73 | {
74 | "child_id": "4",
75 | "name": "红色卫衣",
76 | "image": "../../../images/index/product04.png"
77 | },
78 | {
79 | "child_id": "1",
80 | "name": "潮人必备",
81 | "image": "../../../images/index/product02.png"
82 | },
83 | {
84 | "child_id": "2",
85 | "name": "耐克系列",
86 | "image": "../../../images/index/product01.png"
87 | },
88 | {
89 | "child_id": "3",
90 | "name": "安踏系列",
91 | "image": "../../../images/index/product05.png"
92 | },
93 | {
94 | "child_id": "4",
95 | "name": "红色卫衣",
96 | "image": "../../../images/index/product04.png"
97 | },
98 | {
99 | "child_id": "5",
100 | "name": "高仿卫衣",
101 | "image": "../../../images/index/product01.png"
102 | },
103 | {
104 | "child_id": "6",
105 | "name": "西西卫衣",
106 | "image": "../../../images/index/product04.png"
107 | },
108 | {
109 | "child_id": "7",
110 | "name": "两元卫衣",
111 | "image": "../../../images/index/product05.png"
112 | },
113 | {
114 | "child_id": "8",
115 | "name": "冒牌卫衣",
116 | "image": "../../../images/index/product01.png"
117 | },
118 | {
119 | "child_id": "4",
120 | "name": "红色卫衣",
121 | "image": "../../../images/index/product04.png"
122 | },
123 | {
124 | "child_id": "5",
125 | "name": "高仿卫衣",
126 | "image": "../../../images/index/product01.png"
127 | },
128 | {
129 | "child_id": "6",
130 | "name": "西西卫衣",
131 | "image": "../../../images/index/product04.png"
132 | }
133 | ]
134 | },
135 | {
136 | "cate_id": "3",
137 | "cate_name": "家用电器",
138 | "children": [
139 | {
140 | "child_id": "3",
141 | "name": "安踏系列",
142 | "image": "../../../images/index/product05.png"
143 | },
144 | {
145 | "child_id": "1",
146 | "name": "潮人必备",
147 | "image": "../../../images/index/product02.png"
148 | },
149 | {
150 | "child_id": "2",
151 | "name": "耐克系列",
152 | "image": "../../../images/index/product01.png"
153 | },
154 | {
155 | "child_id": "3",
156 | "name": "安踏系列",
157 | "image": "../../../images/index/product05.png"
158 | },
159 | {
160 | "child_id": "4",
161 | "name": "红色卫衣",
162 | "image": "../../../images/index/product04.png"
163 | },
164 | {
165 | "child_id": "5",
166 | "name": "高仿卫衣",
167 | "image": "../../../images/index/product01.png"
168 | },
169 | {
170 | "child_id": "6",
171 | "name": "西西卫衣",
172 | "image": "../../../images/index/product04.png"
173 | },
174 | {
175 | "child_id": "7",
176 | "name": "两元卫衣",
177 | "image": "../../../images/index/product05.png"
178 | },
179 | {
180 | "child_id": "8",
181 | "name": "冒牌卫衣",
182 | "image": "../../../images/index/product01.png"
183 | }
184 | ]
185 | },
186 | {
187 | "cate_id": "4",
188 | "cate_name": "鞋靴箱包",
189 | "children": [
190 | {
191 | "child_id": "3",
192 | "name": "安踏系列",
193 | "image": "../../../images/index/product05.png"
194 | },
195 | {
196 | "child_id": "4",
197 | "name": "红色卫衣",
198 | "image": "../../../images/index/product04.png"
199 | },
200 | {
201 | "child_id": "1",
202 | "name": "潮人必备",
203 | "image": "../../../images/index/product02.png"
204 | },
205 | {
206 | "child_id": "2",
207 | "name": "耐克系列",
208 | "image": "../../../images/index/product01.png"
209 | },
210 | {
211 | "child_id": "3",
212 | "name": "安踏系列",
213 | "image": "../../../images/index/product05.png"
214 | },
215 | {
216 | "child_id": "5",
217 | "name": "高仿卫衣",
218 | "image": "../../../images/index/product01.png"
219 | },
220 | {
221 | "child_id": "6",
222 | "name": "西西卫衣",
223 | "image": "../../../images/index/product04.png"
224 | },
225 | {
226 | "child_id": "7",
227 | "name": "两元卫衣",
228 | "image": "../../../images/index/product05.png"
229 | },
230 | {
231 | "child_id": "8",
232 | "name": "冒牌卫衣",
233 | "image": "../../../images/index/product01.png"
234 | }
235 | ]
236 | },
237 | {
238 | "cate_id": "5",
239 | "cate_name": "运动户外",
240 | "children": [
241 | {
242 | "child_id": "3",
243 | "name": "安踏系列",
244 | "image": "../../../images/index/product05.png"
245 | },
246 | {
247 | "child_id": "4",
248 | "name": "红色卫衣",
249 | "image": "../../../images/index/product04.png"
250 | },
251 | {
252 | "child_id": "1",
253 | "name": "潮人必备",
254 | "image": "../../../images/index/product02.png"
255 | },
256 | {
257 | "child_id": "2",
258 | "name": "耐克系列",
259 | "image": "../../../images/index/product01.png"
260 | },
261 | {
262 | "child_id": "4",
263 | "name": "红色卫衣",
264 | "image": "../../../images/index/product04.png"
265 | },
266 | {
267 | "child_id": "5",
268 | "name": "高仿卫衣",
269 | "image": "../../../images/index/product01.png"
270 | },
271 | {
272 | "child_id": "6",
273 | "name": "西西卫衣",
274 | "image": "../../../images/index/product04.png"
275 | },
276 | {
277 | "child_id": "7",
278 | "name": "两元卫衣",
279 | "image": "../../../images/index/product05.png"
280 | },
281 | {
282 | "child_id": "8",
283 | "name": "冒牌卫衣",
284 | "image": "../../../images/index/product01.png"
285 | }
286 | ]
287 | },
288 | {
289 | "cate_id": "6",
290 | "cate_name": "男装内衣",
291 | "children": [
292 | {
293 | "child_id": "1",
294 | "name": "潮人必备",
295 | "image": "../../../images/index/product02.png"
296 | },
297 | {
298 | "child_id": "2",
299 | "name": "耐克系列",
300 | "image": "../../../images/index/product01.png"
301 | },
302 | {
303 | "child_id": "3",
304 | "name": "安踏系列",
305 | "image": "../../../images/index/product05.png"
306 | },
307 | {
308 | "child_id": "4",
309 | "name": "红色卫衣",
310 | "image": "../../../images/index/product04.png"
311 | },
312 | {
313 | "child_id": "5",
314 | "name": "高仿卫衣",
315 | "image": "../../../images/index/product01.png"
316 | },
317 | {
318 | "child_id": "6",
319 | "name": "西西卫衣",
320 | "image": "../../../images/index/product04.png"
321 | },
322 | {
323 | "child_id": "7",
324 | "name": "两元卫衣",
325 | "image": "../../../images/index/product05.png"
326 | },
327 | {
328 | "child_id": "6",
329 | "name": "西西卫衣",
330 | "image": "../../../images/index/product04.png"
331 | },
332 | {
333 | "child_id": "7",
334 | "name": "两元卫衣",
335 | "image": "../../../images/index/product05.png"
336 | }
337 | ]
338 | },
339 | {
340 | "cate_id": "7",
341 | "cate_name": "冬季潮流",
342 | "children": [
343 | {
344 | "child_id": "1",
345 | "name": "潮人必备",
346 | "image": "../../../images/index/product02.png"
347 | },
348 | {
349 | "child_id": "2",
350 | "name": "耐克系列",
351 | "image": "../../../images/index/product01.png"
352 | },
353 | {
354 | "child_id": "3",
355 | "name": "安踏系列",
356 | "image": "../../../images/index/product05.png"
357 | },
358 | {
359 | "child_id": "4",
360 | "name": "红色卫衣",
361 | "image": "../../../images/index/product04.png"
362 | },
363 | {
364 | "child_id": "5",
365 | "name": "高仿卫衣",
366 | "image": "../../../images/index/product01.png"
367 | },
368 | {
369 | "child_id": "6",
370 | "name": "西西卫衣",
371 | "image": "../../../images/index/product04.png"
372 | },
373 | {
374 | "child_id": "7",
375 | "name": "两元卫衣",
376 | "image": "../../../images/index/product05.png"
377 | },
378 | {
379 | "child_id": "6",
380 | "name": "西西卫衣",
381 | "image": "../../../images/index/product04.png"
382 | },
383 | {
384 | "child_id": "7",
385 | "name": "两元卫衣",
386 | "image": "../../../images/index/product05.png"
387 | },
388 | {
389 | "child_id": "4",
390 | "name": "红色卫衣",
391 | "image": "../../../images/index/product04.png"
392 | },
393 | {
394 | "child_id": "5",
395 | "name": "高仿卫衣",
396 | "image": "../../../images/index/product01.png"
397 | },
398 | {
399 | "child_id": "6",
400 | "name": "西西卫衣",
401 | "image": "../../../images/index/product04.png"
402 | }
403 | ]
404 | }
405 | ]
406 | }
--------------------------------------------------------------------------------