├── .gitignore ├── App.vue ├── LICENSE ├── README.md ├── api └── backend.js ├── app.js ├── colorui ├── animation.css ├── components │ └── cu-custom.vue ├── icon.css └── main.css ├── components ├── FabBtn │ └── index.vue ├── ListCell │ └── index.vue ├── LoadMore │ └── index.vue ├── Loading │ └── index.vue ├── ProductList │ ├── BoxLayout.vue │ ├── HorizontalLayout.vue │ ├── HorizontalLayout2.vue │ └── HorizontalScrollLayout.vue ├── Refresh │ └── index.vue ├── Share │ └── index.vue ├── SortNavbar │ └── index.vue ├── SortNavbar2 │ └── index.vue ├── Tab │ └── index.vue └── Tab2 │ └── index.vue ├── config.js ├── main.js ├── manifest.json ├── pages.json ├── pages ├── category │ └── category.vue ├── collect │ ├── collect.vue │ └── components │ │ └── CollectList.vue ├── collocation │ ├── component │ │ ├── CollocationBox.vue │ │ ├── CollocationCard.vue │ │ └── CollocationList.vue │ ├── detail.vue │ └── index.vue ├── halfPrice │ └── index.vue ├── index │ └── index.vue ├── nine │ └── nine.vue ├── product │ ├── list.vue │ └── product.vue ├── public │ ├── guide.vue │ └── login.vue ├── rank │ └── rank.vue ├── search │ ├── result.vue │ └── search.vue ├── user │ ├── message.vue │ ├── set.vue │ └── user.vue └── webview │ └── index.vue ├── static ├── errorImage.jpg ├── female.png ├── logo.png ├── male.png ├── refresh │ ├── loading.png │ └── xiangxia.png ├── splash.9.png └── tab │ ├── circle.png │ ├── circle_cur.png │ ├── home.png │ ├── home_cur.png │ ├── my.png │ ├── my_cur.png │ ├── shop.png │ └── shop_cur.png ├── store └── index.js ├── style └── app.scss ├── uni.scss └── utils ├── cache.js ├── http.js └── mcUtils.js /.gitignore: -------------------------------------------------------------------------------- 1 | unpackage 2 | .idea 3 | -------------------------------------------------------------------------------- /App.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 项目已被迁移到新的地址:https://github.com/silently9527/coupons 2 | -------------------------------------------------------------------------------- /api/backend.js: -------------------------------------------------------------------------------- 1 | import httpRequest from '../utils/http' 2 | 3 | module.exports = { 4 | login: function (provider, code) { 5 | let url = '/auth/miniprogram'; 6 | if (provider === 'qq') { 7 | url = '/auth/QQMiniProgram' 8 | } 9 | return httpRequest.get(url, {code: code}) 10 | }, 11 | htmlLogin: function (mobile, code) { 12 | return httpRequest.post('/login', {mobile: mobile, code: code}) 13 | }, 14 | logout: function () { 15 | return httpRequest.get('/logout') 16 | }, 17 | getLoginUser: function () { 18 | return httpRequest.get('/user/current_user', {}) 19 | }, 20 | sendEmailCode: function (params) { 21 | return httpRequest.post('/mi/send_email_code', params) 22 | }, 23 | updatePassword: function (params) { 24 | return httpRequest.post('/mi/update_password', params) 25 | }, 26 | register: function (user) { 27 | return httpRequest.post('/mi/register', user) 28 | }, 29 | updateUserInfo: function (user) { 30 | return httpRequest.post('/user/update', user) 31 | }, 32 | initUserInfo: function (user) { 33 | return httpRequest.post('/user/init_current_user', user) 34 | }, 35 | getCate: function () { 36 | return httpRequest.get('/mi/load_cate', {}) 37 | }, 38 | recommendGoods: function (page) { 39 | return httpRequest.get('/mi/load_recommend_goods', {page: page}) 40 | }, 41 | getGoodsDetail: function (id, goodsId) { 42 | let params = {}; 43 | if (id) { 44 | params.id = id 45 | } 46 | if (goodsId) { 47 | params.goodsId = goodsId 48 | } 49 | return httpRequest.get('/mi/goods_detail', params) 50 | }, 51 | getGoodsByCate: function (subcid, page, sort) { 52 | return httpRequest.get('/mi/load_goods_by_cate', {subcid: subcid, page: page, sort: sort}) 53 | }, 54 | getPrivilegeLink: function (goodsId) { 55 | return httpRequest.get('/mi/get_privilege_link', {goodsId: goodsId}) 56 | }, 57 | getHotSearch: function () { 58 | return httpRequest.get('/mi/get_hot_search', {}) 59 | }, 60 | search: function (keyword, page, sort) { 61 | return httpRequest.get('/mi/search', {keyword: keyword, page: page, sort: sort}) 62 | }, 63 | search2: function (keyword, page, sort, hasCoupon) { 64 | return httpRequest.get('/mi/search2', {keyword: keyword, page: page, sort: sort, hasCoupon: hasCoupon}) 65 | }, 66 | favoriteGoods: function (goodsId) { 67 | return httpRequest.get('/collection/product/add', {productId: goodsId}) 68 | }, 69 | unFavoriteGoods: function (goodsId) { 70 | return httpRequest.get('/collection/product/remove', {productId: goodsId}) 71 | }, 72 | favoriteList: function (page, size) { 73 | return httpRequest.get('/collection/product/list', {page: page, size: size}) 74 | }, 75 | getNineGoods: function (page, size, nineCid) { 76 | return httpRequest.get('/mi/load_nine_goods', {page: page, size: size, nineCid: nineCid}) 77 | }, 78 | getRankGoods: function (cid) { 79 | return httpRequest.get('/mi/load_rank_goods', {cid: cid}) 80 | }, 81 | getSimilarGoods: function (daTaoKeGoodsId) { 82 | return httpRequest.get('/mi/get_similar_goods', {daTaoKeGoodsId: daTaoKeGoodsId}) 83 | }, 84 | listCarousel: function () { 85 | return httpRequest.post('/mi/list_carousel', {}) 86 | }, 87 | listMenus: function () { 88 | return httpRequest.post('/mi/list_menus', {}) 89 | }, 90 | recommendCollocations: function (page) { 91 | return httpRequest.get('/mi/collocation/load_recommend', {page}) 92 | }, 93 | collocationsList: function (page, sex) { 94 | if (sex) { 95 | return httpRequest.get('/mi/collocation/list', {page: page, sex: sex}) 96 | } 97 | return httpRequest.get('/mi/collocation/list', {page}) 98 | }, 99 | recommendCollocations2: function (page) { 100 | return httpRequest.get('/mi/collocation/load_recommend2', {page}) 101 | }, 102 | addCollocationAppreciate: function (collocationId) { 103 | return httpRequest.get('/collocation/add_appreciate', {collocationId}) 104 | }, 105 | cancelCollocationAppreciate: function (collocationId) { 106 | return httpRequest.get('/collocation/cancel_appreciate', {collocationId}) 107 | }, 108 | collocationSimpleDetail: function (collocationId) { 109 | return httpRequest.get('/mi/collocation/simple_detail', {collocationId}) 110 | }, 111 | collocationProduct: function (collocationId) { 112 | return httpRequest.get('/mi/collocation/product', {collocationId}) 113 | } 114 | } 115 | 116 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | export default { 4 | initTitleNav() { 5 | uni.getSystemInfo({ 6 | success: function (e) { 7 | // #ifndef MP 8 | Vue.prototype.StatusBar = e.statusBarHeight; 9 | if (e.platform === 'android') { 10 | Vue.prototype.CustomBar = e.statusBarHeight + 50; 11 | } else { 12 | Vue.prototype.CustomBar = e.statusBarHeight + 45; 13 | } 14 | // #endif 15 | // #ifdef MP-WEIXIN 16 | Vue.prototype.StatusBar = e.statusBarHeight; 17 | let custom = wx.getMenuButtonBoundingClientRect(); 18 | Vue.prototype.Custom = custom; 19 | Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight; 20 | // #endif 21 | // #ifdef MP-ALIPAY 22 | // Vue.prototype.StatusBar = e.statusBarHeight; 23 | // Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight; 24 | // #endif 25 | // #ifdef MP-QQ 26 | Vue.prototype.StatusBar = e.statusBarHeight; 27 | let customQQ = qq.getMenuButtonBoundingClientRect(); 28 | Vue.prototype.Custom = customQQ; 29 | Vue.prototype.CustomBar = customQQ.bottom + customQQ.top - e.statusBarHeight; 30 | if (e.model.indexOf("iPhone X") > -1) { 31 | Vue.prototype.CustomBar = 82; 32 | } else { 33 | Vue.prototype.CustomBar = 60; 34 | } 35 | // #endif 36 | // #ifdef MP-TOUTIAO 37 | // Vue.prototype.StatusBar = e.statusBarHeight; 38 | // let customTT = tt.getMenuButtonBoundingClientRect(); 39 | // Vue.prototype.Custom = customTT; 40 | // Vue.prototype.CustomBar = customTT.bottom + customTT.top - e.statusBarHeight 41 | // #endif 42 | } 43 | }) 44 | }, 45 | initShareMenu() { 46 | // #ifdef MP-WEIXIN 47 | wx.showShareMenu({ 48 | withShareTicket: true, 49 | menus: ['shareAppMessage', 'shareTimeline'] 50 | }) 51 | // #endif 52 | // #ifdef MP-QQ 53 | uni.showShareMenu({ 54 | withShareTicket: true 55 | }) 56 | // #endif 57 | } 58 | 59 | }; 60 | -------------------------------------------------------------------------------- /colorui/animation.css: -------------------------------------------------------------------------------- 1 | /* 2 | Animation 微动画 3 | 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28 4 | */ 5 | 6 | /* css 滤镜 控制黑白底色gif的 */ 7 | .gif-black{ 8 | mix-blend-mode: screen; 9 | } 10 | .gif-white{ 11 | mix-blend-mode: multiply; 12 | } 13 | 14 | 15 | /* Animation css */ 16 | [class*=animation-] { 17 | animation-duration: .5s; 18 | animation-timing-function: ease-out; 19 | animation-fill-mode: both 20 | } 21 | 22 | .animation-fade { 23 | animation-name: fade; 24 | animation-duration: .8s; 25 | animation-timing-function: linear 26 | } 27 | 28 | .animation-scale-up { 29 | animation-name: scale-up 30 | } 31 | 32 | .animation-scale-down { 33 | animation-name: scale-down 34 | } 35 | 36 | .animation-slide-top { 37 | animation-name: slide-top 38 | } 39 | 40 | .animation-slide-bottom { 41 | animation-name: slide-bottom 42 | } 43 | 44 | .animation-slide-left { 45 | animation-name: slide-left 46 | } 47 | 48 | .animation-slide-right { 49 | animation-name: slide-right 50 | } 51 | 52 | .animation-shake { 53 | animation-name: shake 54 | } 55 | 56 | .animation-reverse { 57 | animation-direction: reverse 58 | } 59 | 60 | @keyframes fade { 61 | 0% { 62 | opacity: 0 63 | } 64 | 65 | 100% { 66 | opacity: 1 67 | } 68 | } 69 | 70 | @keyframes scale-up { 71 | 0% { 72 | opacity: 0; 73 | transform: scale(.2) 74 | } 75 | 76 | 100% { 77 | opacity: 1; 78 | transform: scale(1) 79 | } 80 | } 81 | 82 | @keyframes scale-down { 83 | 0% { 84 | opacity: 0; 85 | transform: scale(1.8) 86 | } 87 | 88 | 100% { 89 | opacity: 1; 90 | transform: scale(1) 91 | } 92 | } 93 | 94 | @keyframes slide-top { 95 | 0% { 96 | opacity: 0; 97 | transform: translateY(-100%) 98 | } 99 | 100 | 100% { 101 | opacity: 1; 102 | transform: translateY(0) 103 | } 104 | } 105 | 106 | @keyframes slide-bottom { 107 | 0% { 108 | opacity: 0; 109 | transform: translateY(100%) 110 | } 111 | 112 | 100% { 113 | opacity: 1; 114 | transform: translateY(0) 115 | } 116 | } 117 | 118 | @keyframes shake { 119 | 120 | 0%, 121 | 100% { 122 | transform: translateX(0) 123 | } 124 | 125 | 10% { 126 | transform: translateX(-9px) 127 | } 128 | 129 | 20% { 130 | transform: translateX(8px) 131 | } 132 | 133 | 30% { 134 | transform: translateX(-7px) 135 | } 136 | 137 | 40% { 138 | transform: translateX(6px) 139 | } 140 | 141 | 50% { 142 | transform: translateX(-5px) 143 | } 144 | 145 | 60% { 146 | transform: translateX(4px) 147 | } 148 | 149 | 70% { 150 | transform: translateX(-3px) 151 | } 152 | 153 | 80% { 154 | transform: translateX(2px) 155 | } 156 | 157 | 90% { 158 | transform: translateX(-1px) 159 | } 160 | } 161 | 162 | @keyframes slide-left { 163 | 0% { 164 | opacity: 0; 165 | transform: translateX(-100%) 166 | } 167 | 168 | 100% { 169 | opacity: 1; 170 | transform: translateX(0) 171 | } 172 | } 173 | 174 | @keyframes slide-right { 175 | 0% { 176 | opacity: 0; 177 | transform: translateX(100%) 178 | } 179 | 180 | 100% { 181 | opacity: 1; 182 | transform: translateX(0) 183 | } 184 | } -------------------------------------------------------------------------------- /colorui/components/cu-custom.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 89 | 90 | 93 | -------------------------------------------------------------------------------- /components/FabBtn/index.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 214 | 215 | 434 | -------------------------------------------------------------------------------- /components/ListCell/index.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 76 | 77 | 120 | -------------------------------------------------------------------------------- /components/LoadMore/index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 60 | 61 | 196 | -------------------------------------------------------------------------------- /components/Loading/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /components/ProductList/BoxLayout.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 54 | 55 | 175 | -------------------------------------------------------------------------------- /components/ProductList/HorizontalLayout.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | 72 | 73 | 74 | 208 | -------------------------------------------------------------------------------- /components/ProductList/HorizontalLayout2.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 40 | 41 | 42 | 45 | -------------------------------------------------------------------------------- /components/ProductList/HorizontalScrollLayout.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 47 | 48 | 142 | -------------------------------------------------------------------------------- /components/Refresh/index.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 191 | 192 | 193 | 264 | -------------------------------------------------------------------------------- /components/Share/index.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 119 | 120 | 203 | -------------------------------------------------------------------------------- /components/SortNavbar/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 57 | 58 | 138 | -------------------------------------------------------------------------------- /components/SortNavbar2/index.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 67 | 68 | 148 | -------------------------------------------------------------------------------- /components/Tab/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 40 | 41 | 43 | -------------------------------------------------------------------------------- /components/Tab2/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 66 | 67 | 73 | -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // APIHOST: "http://localhost:9090" 3 | } 4 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import store from './store' 3 | import App from './App.vue' 4 | 5 | import backend from './api/backend' 6 | import cache from './utils/cache' 7 | import mcUtils from './utils/mcUtils' 8 | 9 | import TitleNav from './colorui/components/cu-custom.vue' 10 | 11 | Vue.component('title-nav',TitleNav) 12 | 13 | const message = (title, duration=1500, mask=false, icon='none')=>{ 14 | //统一提示方便全局修改 15 | if(Boolean(title) === false){ 16 | return; 17 | } 18 | uni.showToast({ 19 | title, 20 | duration, 21 | mask, 22 | icon 23 | }); 24 | } 25 | 26 | Vue.config.productionTip = false 27 | Vue.prototype.$store = store; 28 | Vue.prototype.$cache = cache; 29 | Vue.prototype.$utils = mcUtils; 30 | Vue.prototype.$message = message; 31 | Vue.prototype.$api = { backend }; 32 | 33 | App.mpType = 'app' 34 | 35 | const app = new Vue({ 36 | ...App 37 | }) 38 | app.$mount() 39 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "FASHION", 3 | "appid" : "__UNI__AA9534D", 4 | "description" : "我不塑造时尚,我就是时尚", 5 | "versionName" : "1.6.1", 6 | "versionCode" : 161, 7 | "transformPx" : false, 8 | "app-plus" : { 9 | /* 5+App特有相关 */ 10 | "usingComponents" : true, 11 | "splashscreen" : { 12 | "alwaysShowBeforeRender" : true, 13 | "waiting" : true, 14 | "autoclose" : true, 15 | "delay" : 0 16 | }, 17 | "modules" : {}, 18 | /* 模块配置 */ 19 | "distribute" : { 20 | /* 应用发布信息 */ 21 | "android" : { 22 | /* android打包配置 */ 23 | "permissions" : [ 24 | "", 25 | "", 26 | "", 27 | "", 28 | "", 29 | "" 30 | ], 31 | "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], 32 | "autoSdkPermissions" : false 33 | }, 34 | "ios" : {}, 35 | /* ios打包配置 */ 36 | "sdkConfigs" : { 37 | "ad" : {} 38 | }, 39 | "icons" : { 40 | "android" : { 41 | "hdpi" : "unpackage/res/icons/72x72.png", 42 | "xhdpi" : "unpackage/res/icons/96x96.png", 43 | "xxhdpi" : "unpackage/res/icons/144x144.png", 44 | "xxxhdpi" : "unpackage/res/icons/192x192.png" 45 | }, 46 | "ios" : { 47 | "appstore" : "unpackage/res/icons/1024x1024.png", 48 | "ipad" : { 49 | "app" : "unpackage/res/icons/76x76.png", 50 | "app@2x" : "unpackage/res/icons/152x152.png", 51 | "notification" : "unpackage/res/icons/20x20.png", 52 | "notification@2x" : "unpackage/res/icons/40x40.png", 53 | "proapp@2x" : "unpackage/res/icons/167x167.png", 54 | "settings" : "unpackage/res/icons/29x29.png", 55 | "settings@2x" : "unpackage/res/icons/58x58.png", 56 | "spotlight" : "unpackage/res/icons/40x40.png", 57 | "spotlight@2x" : "unpackage/res/icons/80x80.png" 58 | }, 59 | "iphone" : { 60 | "app@2x" : "unpackage/res/icons/120x120.png", 61 | "app@3x" : "unpackage/res/icons/180x180.png", 62 | "notification@2x" : "unpackage/res/icons/40x40.png", 63 | "notification@3x" : "unpackage/res/icons/60x60.png", 64 | "settings@2x" : "unpackage/res/icons/58x58.png", 65 | "settings@3x" : "unpackage/res/icons/87x87.png", 66 | "spotlight@2x" : "unpackage/res/icons/80x80.png", 67 | "spotlight@3x" : "unpackage/res/icons/120x120.png" 68 | } 69 | } 70 | }, 71 | "splashscreen" : { 72 | "android" : { 73 | "hdpi" : "/static/splash.9.png", 74 | "xhdpi" : "/static/splash.9.png", 75 | "xxhdpi" : "/static/splash.9.png" 76 | }, 77 | "ios" : { 78 | "iphone" : { 79 | "retina55" : "/Users/huaan9527/Desktop/170券/引导页.png", 80 | "retina55l" : "/Users/huaan9527/Desktop/170券/引导页.png", 81 | "retina47" : "/Users/huaan9527/Desktop/170券/引导页.png", 82 | "retina47l" : "/Users/huaan9527/Desktop/170券/引导页.png", 83 | "portrait-896h@2x" : "/Users/huaan9527/Desktop/170券/引导页.png", 84 | "landscape-896h@3x" : "/Users/huaan9527/Desktop/170券/引导页.png" 85 | }, 86 | "storyboard" : "/Users/huaan9527/Documents/mall-app/storyboard/storyboard.zip" 87 | }, 88 | "iosStyle" : "storyboard", 89 | "androidStyle" : "default" 90 | } 91 | }, 92 | "uniStatistics" : { 93 | "enable" : false 94 | }, 95 | "nativePlugins" : { 96 | "Hs-MobMessage" : { 97 | "MOBAppKey" : "", 98 | "MOBAppSecret" : "", 99 | "__plugin_info__" : { 100 | "name" : "MobSMS免费短信验证码android+ios,苹果已过审", 101 | "description" : "已有应用通过苹果审核,每月免费10000条,可用短信模板ID,可发送文字和语言验证码", 102 | "platforms" : "Android,iOS", 103 | "url" : "https://ext.dcloud.net.cn/plugin?id=2189", 104 | "android_package_name" : "com.huaan9527.mall", 105 | "ios_bundle_id" : "com.huaan9527.mall", 106 | "isCloud" : true, 107 | "bought" : 1, 108 | "pid" : "2189", 109 | "parameters" : { 110 | "MOBAppKey" : { 111 | "des" : "MOBAppKey", 112 | "key" : "MOBAppKey", 113 | "value" : "" 114 | }, 115 | "MOBAppSecret" : { 116 | "des" : "MOBAppSecret", 117 | "key" : "MOBAppSecret", 118 | "value" : "" 119 | } 120 | } 121 | } 122 | } 123 | } 124 | }, 125 | /* SDK配置 */ 126 | "quickapp" : {}, 127 | /* 快应用特有相关 */ 128 | "mp-weixin" : { 129 | /* 小程序特有相关 */ 130 | "usingComponents" : true, 131 | "appid" : "", 132 | "setting" : { 133 | "urlCheck" : true, 134 | "es6" : true, 135 | "postcss" : true, 136 | "minified" : true 137 | }, 138 | "uniStatistics" : { 139 | "enable" : false 140 | } 141 | }, 142 | "mp-qq" : { 143 | "appid" : "", 144 | "setting" : { 145 | "minified" : true, 146 | "es6" : true, 147 | "postcss" : true, 148 | "urlCheck" : true 149 | }, 150 | "uniStatistics" : { 151 | "enable" : false 152 | } 153 | }, 154 | "mp-toutiao" : { 155 | "appid" : "", 156 | "setting" : { 157 | "es6" : true, 158 | "postcss" : true, 159 | "minified" : true 160 | }, 161 | "uniStatistics" : { 162 | "enable" : false 163 | } 164 | }, 165 | "uniStatistics" : { 166 | "enable" : false 167 | }, 168 | "h5" : { 169 | "uniStatistics" : { 170 | "enable" : false 171 | }, 172 | "domain" : "http://m.szjx.top", 173 | "title" : "FASHION搭配助手", 174 | "router" : { 175 | "mode" : "hash" 176 | } 177 | }, 178 | "mp-alipay" : { 179 | "uniStatistics" : { 180 | "enable" : false 181 | } 182 | }, 183 | "mp-baidu" : { 184 | "uniStatistics" : { 185 | "enable" : false 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /pages.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | { 4 | "path": "pages/collocation/index", 5 | "style": {} 6 | }, 7 | { 8 | "path": "pages/collocation/detail", 9 | "style": {} 10 | }, 11 | { 12 | "path": "pages/index/index", 13 | "style": { 14 | } 15 | }, 16 | { 17 | "path": "pages/webview/index", 18 | "style": { 19 | "navigationStyle": "default", 20 | "app-plus": { 21 | "titleNView": { 22 | "titleText": "加载中" 23 | } 24 | } 25 | } 26 | }, 27 | { 28 | "path": "pages/nine/nine", 29 | "style": { 30 | } 31 | }, 32 | { 33 | "path": "pages/rank/rank", 34 | "style": { 35 | } 36 | }, 37 | { 38 | "path": "pages/halfPrice/index", 39 | "style": { 40 | } 41 | }, 42 | { 43 | "path": "pages/product/product", 44 | "style": {} 45 | }, 46 | { 47 | "path": "pages/collect/collect", 48 | "style": {} 49 | }, 50 | { 51 | "path": "pages/user/user", 52 | "style": {} 53 | }, 54 | { 55 | "path": "pages/public/guide", 56 | "style": {} 57 | }, 58 | { 59 | "path": "pages/category/category", 60 | "style": {} 61 | }, 62 | { 63 | "path": "pages/product/list", 64 | "style": {} 65 | }, 66 | { 67 | "path": "pages/search/search", 68 | "style": {} 69 | }, 70 | { 71 | "path": "pages/search/result", 72 | "style": {} 73 | }, 74 | { 75 | "path": "pages/public/login", 76 | "style": {} 77 | }, 78 | { 79 | "path": "pages/user/set", 80 | "style": {} 81 | }, 82 | { 83 | "path": "pages/user/message", 84 | "style": {} 85 | } 86 | ], 87 | "globalStyle": { 88 | "navigationBarTextStyle": "black", 89 | "navigationBarTitleText": "FASHION搭配助手", 90 | "navigationBarBackgroundColor": "#FFFFFF", 91 | "backgroundColor": "#f8f8f8", 92 | "navigationStyle": "custom" 93 | }, 94 | "tabBar": { 95 | "backgroundColor": "#ffffff", 96 | "color": "#000000", 97 | "selectedColor": "#000000", 98 | "list": [ 99 | { 100 | "pagePath": "pages/collocation/index", 101 | "iconPath": "static/tab/home.png", 102 | "text": "", 103 | "selectedIconPath": "static/tab/home_cur.png" 104 | }, 105 | { 106 | "pagePath": "pages/category/category", 107 | "iconPath": "static/tab/circle.png", 108 | "text": "", 109 | "selectedIconPath": "static/tab/circle_cur.png" 110 | }, 111 | { 112 | "pagePath": "pages/index/index", 113 | "iconPath": "static/tab/shop.png", 114 | "text": "", 115 | "selectedIconPath": "static/tab/shop_cur.png" 116 | }, 117 | { 118 | "pagePath": "pages/user/user", 119 | "iconPath": "static/tab/my.png", 120 | "text": "", 121 | "selectedIconPath": "static/tab/my_cur.png" 122 | } 123 | ] 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /pages/category/category.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 100 | 101 | 162 | -------------------------------------------------------------------------------- /pages/collect/collect.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 105 | 106 | 163 | -------------------------------------------------------------------------------- /pages/collect/components/CollectList.vue: -------------------------------------------------------------------------------- 1 | 45 | 46 | 79 | 80 | 180 | -------------------------------------------------------------------------------- /pages/collocation/component/CollocationBox.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 36 | 37 | 59 | -------------------------------------------------------------------------------- /pages/collocation/component/CollocationCard.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 54 | 55 | 73 | -------------------------------------------------------------------------------- /pages/collocation/component/CollocationList.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 62 | 63 | 88 | -------------------------------------------------------------------------------- /pages/collocation/detail.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | 122 | 123 | 194 | -------------------------------------------------------------------------------- /pages/collocation/index.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 172 | 173 | 178 | -------------------------------------------------------------------------------- /pages/halfPrice/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 91 | 92 | 98 | -------------------------------------------------------------------------------- /pages/index/index.vue: -------------------------------------------------------------------------------- 1 | 48 | 49 | 155 | 156 | 259 | -------------------------------------------------------------------------------- /pages/nine/nine.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 103 | 104 | 110 | -------------------------------------------------------------------------------- /pages/product/list.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 81 | 82 | 88 | -------------------------------------------------------------------------------- /pages/product/product.vue: -------------------------------------------------------------------------------- 1 | 166 | 167 | 373 | 374 | 778 | -------------------------------------------------------------------------------- /pages/public/guide.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 78 | 79 | 82 | -------------------------------------------------------------------------------- /pages/public/login.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 149 | 150 | 183 | -------------------------------------------------------------------------------- /pages/rank/rank.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 81 | 82 | 88 | -------------------------------------------------------------------------------- /pages/search/result.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 87 | 88 | 94 | -------------------------------------------------------------------------------- /pages/search/search.vue: -------------------------------------------------------------------------------- 1 | 68 | 69 | 223 | 309 | -------------------------------------------------------------------------------- /pages/user/message.vue: -------------------------------------------------------------------------------- 1 | 57 | 58 | 70 | 71 | 157 | -------------------------------------------------------------------------------- /pages/user/set.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 74 | 75 | 125 | -------------------------------------------------------------------------------- /pages/user/user.vue: -------------------------------------------------------------------------------- 1 | 78 | 150 | 172 | -------------------------------------------------------------------------------- /pages/webview/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /static/errorImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/errorImage.jpg -------------------------------------------------------------------------------- /static/female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/female.png -------------------------------------------------------------------------------- /static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/logo.png -------------------------------------------------------------------------------- /static/male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/male.png -------------------------------------------------------------------------------- /static/refresh/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/refresh/loading.png -------------------------------------------------------------------------------- /static/refresh/xiangxia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/refresh/xiangxia.png -------------------------------------------------------------------------------- /static/splash.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/splash.9.png -------------------------------------------------------------------------------- /static/tab/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/circle.png -------------------------------------------------------------------------------- /static/tab/circle_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/circle_cur.png -------------------------------------------------------------------------------- /static/tab/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/home.png -------------------------------------------------------------------------------- /static/tab/home_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/home_cur.png -------------------------------------------------------------------------------- /static/tab/my.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/my.png -------------------------------------------------------------------------------- /static/tab/my_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/my_cur.png -------------------------------------------------------------------------------- /static/tab/shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/shop.png -------------------------------------------------------------------------------- /static/tab/shop_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silently9527/mall-coupons/f843dcefa1f3d12173dd02ab3da8c2de76cebc88/static/tab/shop_cur.png -------------------------------------------------------------------------------- /store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import api from "../api/backend"; 4 | 5 | Vue.use(Vuex) 6 | 7 | const store = new Vuex.Store({ 8 | state: { 9 | accessToken: undefined, 10 | hasLogin: false, 11 | userInfo: undefined, 12 | shareTicket: undefined 13 | }, 14 | getters: { 15 | accessToken: state => { 16 | if (state.accessToken) { 17 | return state.accessToken; 18 | } 19 | return uni.getStorageSync('mall_coupons_access_token'); 20 | }, 21 | hasLogin: state => { 22 | if (state.hasLogin) { 23 | return state.hasLogin; 24 | } 25 | return uni.getStorageSync('mall_coupons_has_login'); 26 | }, 27 | userInfo: state => { 28 | if (state.userInfo) { 29 | return state.userInfo; 30 | } 31 | return uni.getStorageSync('mall_coupons_user_info') 32 | }, 33 | avatar: state => { 34 | if (state.userInfo && state.userInfo.avatarUrl) { 35 | return state.userInfo.avatarUrl; 36 | } 37 | return 'http://file.szjx.top/fashion/missing-face.png'; 38 | } 39 | }, 40 | mutations: { 41 | login(state, param) { 42 | uni.login({ 43 | provider: param.provider, 44 | success: (response) => { 45 | api.login(param.provider, response.code).then(resp => { 46 | let token = resp.data.xAuthToken 47 | state.accessToken = token; 48 | uni.setStorage({key: 'mall_coupons_access_token', data: token}); 49 | 50 | api.getLoginUser().then(resp => { 51 | state.hasLogin = true; 52 | state.userInfo = resp.data 53 | if (!resp.data.nick) { 54 | api.initUserInfo({ 55 | nick: param.userInfo.nickName, 56 | avatarUrl: param.userInfo.avatarUrl, 57 | city: param.userInfo.city, 58 | country: param.userInfo.country, 59 | province: param.userInfo.province, 60 | sex: param.userInfo.gender 61 | }).then((user) => { 62 | let userinfo = user.data 63 | state.hasLogin = true; 64 | state.userInfo = userinfo; 65 | uni.setStorage({key: 'mall_coupons_has_login', data: true}); 66 | uni.setStorage({key: 'mall_coupons_user_info', data: userinfo}); 67 | }); 68 | } 69 | }) 70 | }) 71 | } 72 | }); 73 | }, 74 | storeShareTicket(state, shareTicket) { 75 | state.shareTicket = shareTicket; 76 | }, 77 | storeToken(state, token) { 78 | state.accessToken = token; 79 | uni.setStorage({key: 'mall_coupons_access_token', data: token}); 80 | }, 81 | storeUser(state, user) { 82 | state.hasLogin = true; 83 | state.userInfo = user; 84 | uni.setStorage({key: 'mall_coupons_has_login', data: true}); 85 | uni.setStorage({key: 'mall_coupons_user_info', data: user}); 86 | }, 87 | logout(state) { 88 | api.logout(); 89 | state.hasLogin = false; 90 | state.userInfo = undefined; 91 | uni.removeStorage({ 92 | key: 'mall_coupons_access_token' 93 | }); 94 | uni.removeStorage({ 95 | key: 'mall_coupons_has_login' 96 | }); 97 | uni.removeStorage({ 98 | key: 'mall_coupons_user_info' 99 | }); 100 | } 101 | }, 102 | actions: {} 103 | }) 104 | 105 | export default store 106 | -------------------------------------------------------------------------------- /style/app.scss: -------------------------------------------------------------------------------- 1 | view, 2 | scroll-view, 3 | swiper, 4 | swiper-item, 5 | cover-view, 6 | cover-image, 7 | icon, 8 | text, 9 | rich-text, 10 | progress, 11 | button, 12 | checkbox, 13 | form, 14 | input, 15 | label, 16 | radio, 17 | slider, 18 | switch, 19 | textarea, 20 | navigator, 21 | audio, 22 | camera, 23 | image, 24 | video { 25 | box-sizing: border-box; 26 | } 27 | 28 | /* 图片载入替代方案 */ 29 | .image-wrapper { 30 | font-size: 0; 31 | background: #f3f3f3; 32 | border-radius: 4px; 33 | 34 | image { 35 | width: 100%; 36 | height: 100%; 37 | transition: .6s; 38 | opacity: 0; 39 | 40 | &.loaded { 41 | opacity: 1; 42 | } 43 | } 44 | } 45 | 46 | .clamp { 47 | overflow: hidden; 48 | text-overflow: ellipsis; 49 | white-space: nowrap; 50 | display: block; 51 | } 52 | 53 | .common-hover { 54 | background: #f5f5f5; 55 | } 56 | 57 | /*边框*/ 58 | .b-b:after, 59 | .b-t:after { 60 | position: absolute; 61 | z-index: 3; 62 | left: 0; 63 | right: 0; 64 | height: 0; 65 | content: ''; 66 | transform: scaleY(.5); 67 | border-bottom: 1px solid $border-color-base; 68 | } 69 | 70 | .b-b:after { 71 | bottom: 0; 72 | } 73 | 74 | .b-t:after { 75 | top: 0; 76 | } 77 | 78 | /* button样式改写 */ 79 | uni-button, 80 | button { 81 | height: 80upx; 82 | line-height: 80upx; 83 | font-size: $font-lg + 2upx; 84 | font-weight: normal; 85 | 86 | &.no-border:before, 87 | &.no-border:after { 88 | border: 0; 89 | } 90 | } 91 | 92 | uni-button[type=default], 93 | button[type=default] { 94 | color: $font-color-dark; 95 | } 96 | 97 | /* input 样式 */ 98 | .input-placeholder { 99 | color: #999999; 100 | } 101 | 102 | .placeholder { 103 | color: #999999; 104 | } 105 | 106 | .tm { 107 | min-width: 23px; 108 | height: 13px; 109 | border-radius: 2px; 110 | background-image: url(https://cmsstatic.ffquan.cn/wap_new/common/images/tm.png); 111 | display: inline-block; 112 | margin-right: 3px; 113 | background-size: 23px 13px; 114 | background-repeat: no-repeat; 115 | background-position: center; 116 | } 117 | 118 | .tb { 119 | min-width: 29px; 120 | height: 13px; 121 | background-color: linear-gradient(142deg,#ff8c02 0,#ff5000 100%); 122 | border-radius: 2px; 123 | background-image: url(https://cmsstatic.ffquan.cn/wap_new/common/images/tb.png); 124 | display: inline-block; 125 | background-size: 29px 13px; 126 | background-repeat: no-repeat; 127 | background-position: center; 128 | margin-right: 2px; 129 | } 130 | -------------------------------------------------------------------------------- /uni.scss: -------------------------------------------------------------------------------- 1 | /* 页面左右间距 */ 2 | $page-row-spacing: 30upx; 3 | $page-color-base: #f8f8f8; 4 | $page-color-light: #f8f6fc; 5 | $base-color: #fa436a; 6 | 7 | /* 文字尺寸 */ 8 | $font-sm: 24upx; 9 | $font-base: 28upx; 10 | $font-lg: 32upx; 11 | /*文字颜色*/ 12 | $font-color-dark: #303133; 13 | $font-color-base: #606266; 14 | $font-color-light: #909399; 15 | $font-color-disabled: #C0C4CC; 16 | $font-color-spec: #4399fc; 17 | /* 边框颜色 */ 18 | $border-color-dark: #DCDFE6; 19 | $border-color-base: #E4E7ED; 20 | $border-color-light: #EBEEF5; 21 | /* 图片加载中颜色 */ 22 | $image-bg-color: #eee; 23 | /* 行为相关颜色 */ 24 | $uni-color-primary:#fa436a; 25 | $uni-color-success: #4cd964; 26 | $uni-color-warning: #f0ad4e; 27 | $uni-color-error: #dd524d; 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /utils/cache.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 缓存数据优化 3 | * var cache = require('utils/cache.js'); 4 | * import cache from '../cache' 5 | * 使用方法 【 6 | * 一、设置缓存 7 | * string cache.put('k', 'string你好啊'); 8 | * json cache.put('k', { "b": "3" }, 2); 9 | * array cache.put('k', [1, 2, 3]); 10 | * boolean cache.put('k', true); 11 | * 二、读取缓存 12 | * 默认值 cache.get('k') 13 | * string cache.get('k', '你好') 14 | * json cache.get('k', { "a": "1" }) 15 | * 三、移除/清理 16 | * 移除: cache.remove('k'); 17 | * 清理:cache.clear(); 18 | * 】 19 | * @type {String} 20 | */ 21 | var postfix = '_mallStore'; // 缓存前缀 22 | /** 23 | * 设置缓存 24 | * @param {[type]} k [键名] 25 | * @param {[type]} v [键值] 26 | * @param {[type]} t [时间、单位秒] 27 | */ 28 | function put(k, v, t) { 29 | uni.setStorageSync(k, v) 30 | var seconds = parseInt(t); 31 | if (seconds > 0) { 32 | var timestamp = Date.parse(new Date()); 33 | timestamp = timestamp / 1000 + seconds; 34 | uni.setStorageSync(k + postfix, timestamp + "") 35 | } else { 36 | uni.removeStorageSync(k + postfix) 37 | } 38 | } 39 | 40 | 41 | /** 42 | * 获取缓存 43 | * @param {[type]} k [键名] 44 | * @param {[type]} def [获取为空时默认] 45 | */ 46 | function get(k, def) { 47 | var deadtime = parseInt(uni.getStorageSync(k + postfix)) 48 | if (deadtime) { 49 | if (parseInt(deadtime) < Date.parse(new Date()) / 1000) { 50 | if (def) { 51 | return def; 52 | } else { 53 | return false; 54 | } 55 | } 56 | } 57 | var res = uni.getStorageSync(k); 58 | if (res) { 59 | return res; 60 | } else { 61 | if (def === undefined || def === "") { 62 | def = false; 63 | } 64 | return def; 65 | } 66 | } 67 | 68 | function remove(k) { 69 | uni.removeStorageSync(k); 70 | uni.removeStorageSync(k + postfix); 71 | } 72 | 73 | /** 74 | * 清理所有缓存 75 | * @return {[type]} [description] 76 | */ 77 | function clear() { 78 | uni.clearStorageSync(); 79 | } 80 | 81 | 82 | module.exports = { 83 | put: put, 84 | get: get, 85 | remove: remove, 86 | clear: clear, 87 | } -------------------------------------------------------------------------------- /utils/http.js: -------------------------------------------------------------------------------- 1 | import configdata from '../config' 2 | import cache from './cache' 3 | import store from '../store/index'; 4 | 5 | module.exports = { 6 | config: function(name) { 7 | var info = null; 8 | if (name) { 9 | var name2 = name.split("."); //字符分割 10 | if (name2.length > 1) { 11 | info = configdata[name2[0]][name2[1]] || null; 12 | } else { 13 | info = configdata[name] || null; 14 | } 15 | if (info == null) { 16 | let web_config = cache.get("web_config"); 17 | if (web_config) { 18 | if (name2.length > 1) { 19 | info = web_config[name2[0]][name2[1]] || null; 20 | } else { 21 | info = web_config[name] || null; 22 | } 23 | } 24 | } 25 | } 26 | return info; 27 | }, 28 | post: function(url, data, xAuthToken = true) { 29 | url = this.config("APIHOST")+url; 30 | let header = { 31 | "content-type": "application/x-www-form-urlencoded" 32 | } 33 | if (xAuthToken) { 34 | header = { 35 | "content-type": "application/x-www-form-urlencoded", 36 | "X-Auth-Token": store.getters.accessToken 37 | } 38 | } 39 | return new Promise((succ, error) => { 40 | uni.request({ 41 | url: url, 42 | data: data, 43 | method: "POST", 44 | header: header, 45 | success: function(result) { 46 | succ.call(self, result.data) 47 | }, 48 | fail: function(e) { 49 | error.call(self, e) 50 | } 51 | }) 52 | }) 53 | }, 54 | get: function(url, data, xAuthToken = true) { 55 | url = this.config("APIHOST")+url; 56 | let header = { 57 | "content-type": "application/x-www-form-urlencoded" 58 | } 59 | if (xAuthToken) { 60 | header = { 61 | "content-type": "application/x-www-form-urlencoded", 62 | "X-Auth-Token": store.getters.accessToken 63 | } 64 | } 65 | return new Promise((succ, error) => { 66 | uni.request({ 67 | url: url, 68 | data: data, 69 | method: "GET", 70 | header: header, 71 | success: function(result) { 72 | succ.call(self, result.data) 73 | }, 74 | fail: function(e) { 75 | error.call(self, e) 76 | } 77 | }) 78 | }) 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /utils/mcUtils.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | getShareInfo: (shareTicket, callback) => { 3 | if (!shareTicket) { 4 | return; 5 | } 6 | // #ifdef MP-WEIXIN 7 | wx.getShareInfo({ 8 | shareTicket: shareTicket, 9 | timeout: 5000, 10 | success: callback 11 | }) 12 | // #endif 13 | // #ifdef MP-QQ 14 | qq.getShareInfo({ 15 | shareTicket: shareTicket, 16 | timeout: 5000, 17 | success: callback 18 | }) 19 | // #endif 20 | } 21 | } 22 | --------------------------------------------------------------------------------