Commit 032a549b by shibukun

代码修改

parent 6aadc432
.hbuilderx
unpackage
node_modules
package-lock.json
\ No newline at end of file
package-lock.json
/unpackage/
unpackage/
\ No newline at end of file
......@@ -12,12 +12,12 @@
</view>
</view>
<view class="list">
<view class="item" v-for="(item, index) in brandList" :key="index" @click="goToGoodDetail(item.brandNo)">
<view class="item" v-for="(item, index) in brandList" :key="index" @click="goToGoodDetail(item.brandNo, item.name)">
<view class="item-layout">
<image class="icon" mode="aspectFill" :src="item.imgPath"></image>
<view class="item-right">
<text class="item-title">{{item.name}}</text>
<text class="item-desc">{{item.des}}</text>
<text class="item-title">{{ item.name }}</text>
<text class="item-desc">{{ item.des }}</text>
</view>
</view>
</view>
......@@ -43,58 +43,59 @@ export default {
this.getData();
},
onShow() {
this.getUserInfo()
console.log('onShow');
this.getUserInfo();
},
methods: {
goLogin() {
this.$router.push('Login');
},
getUserInfo() {
if(this.$net.tokenGet().length > 0) {
this.isLogin = true
this.$net.get('/staff/detail', {})
.then(res => {
this.name = res.accountName
this.integralCount = res.allIntegral
})
.catch(err => {
console.log(err)
})
} else {
// 未登录
this.isLogin = false
}
this.isLogin = true;
this.$net
.get('/staff/detail', {})
.then(res => {
if (res.code === 200) {
this.name = res.data.staffName;
this.integralCount = res.data.allIntegral;
this.isLogin = true
} else {
this.isLogin = false
}
})
.catch(err => {
console.log(err);
this.isLogin = false
});
},
getData() {
this.$net
.get('/goods/brand', { page: this.page, pageSize: this.pageSize })
.then(res => {
if (res.data.list.length > 0) {
this.brandList = this.brandList.concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list).concat(res.data.list);
this.page += 1
this.brandList = this.brandList
.concat(res.data.list);
this.page += 1;
}
this.loadingType = res.data.list.length < this.pageSize ? 'noMore' : 'more';
console.log(this.loadingType)
console.log(this.loadingType);
})
.catch(err => {
console.log(err);
});
},
goToGoodDetail(brandNo) {
goToGoodDetail(brandNo, brandName) {
if (!this.isLogin) {
this.goLogin()
this.goLogin();
}
this.$router.push('GoodSkuList', {brandNo: brandNo})
this.$router.push('GoodSkuList', { brandNo: brandNo, brandName: brandName });
},
goIntegralDetail() {
if (!this.isLogin) {
this.goLogin()
this.goLogin();
}
}
}
};
</script>
......
<template>
<view class="layout">
<view class="list">
<view class="item" v-for="(item, index) in goodList" :key="index">
<view class="item" v-for="(item, index) in goodList" @click="goGoodDetail(item.spuNo, item.skuNo)" :key="index">
<image class="img" :src="item.spuImg"></image>
<view class="item-rigth">
<view class="item-right-top">
<text class="item-title">{{ item.name }}{{ item.skuName }}</text>
<text class="item-brand">{{ item.name }}</text>
</view>
<text class="item-title">{{ item.name }}{{ item.skuName }}</text>
<view><text class="item-brand">{{ item.name }}</text></view>
<text class="item-integral">{{ item.sellingPrice }}积分</text>
</view>
</view>
......@@ -28,8 +26,11 @@ export default {
};
},
onLoad(option) {
this.brandNo = option.brandNo
this.brandNo = option.brandNo;
this.getData();
uni.setNavigationBarTitle({
title: option.brandName
})
},
methods: {
getData() {
......@@ -38,14 +39,6 @@ export default {
.then(res => {
if (res.data.list.length > 0) {
this.goodList = this.goodList
.concat(res.data.list)
.concat(res.data.list)
.concat(res.data.list)
.concat(res.data.list)
.concat(res.data.list)
.concat(res.data.list)
.concat(res.data.list)
.concat(res.data.list);
this.page += 1;
}
......@@ -54,6 +47,9 @@ export default {
.catch(err => {
console.log(err);
});
},
goGoodDetail(spuNo, skuNo) {
// todo 商品详情
}
}
};
......@@ -72,45 +68,48 @@ export default {
display: flex;
flex-direction: row;
background: #ffffff;
padding: 12rpx 12rpx;
border-radius: 8rpx;
padding: 20rpx 20rpx;
border-radius: 16rpx;
margin: 12rpx 0;
.img {
width: 100rpx;
height: 100rpx;
border-radius: 4rpx;
width: 200rpx;
height: 200rpx;
border-radius: 8rpx;
}
.item-right {
.item-rigth {
display: flex;
flex-direction: column;
justify-content: space-between;
.item-right-top{
display: flex;
flex-direction: column;
.item-title {
font-size: 14rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20rpx;
overflow: hidden;
text-overflow: ellipsis;
max-lines: 2;
}
.item-brand {
background: rgba(255, 5, 32, 0.03);
border-radius: 4rpx;
border: 1rpx solid #ff0520;
font-size: 11rpx;
color: #ff0520;
line-height: 16rpx;
padding: 0 8rpx;
}
margin-left: 24rpx;
.item-title {
font-size: 28rpx;
color: #333333;
height: 58rpx;
line-height: 28rpx;
overflow: hidden;
min-inline-size: 2;
line-clamp: 2;
text-overflow: ellipsis;
max-lines: 2;
}
.item-brand {
background: rgba(255, 5, 32, 0.03);
border-radius: 4rpx;
border: 1rpx solid #ff0520;
font-size: 22rpx;
color: #ff0520;
margin-top: 12rpx;
line-height: 22rpx;
margin-top: 8rpx;
padding: 0 8rpx;
width: auto;
}
.item-integral {
font-size: 16rpx;
font-size: 32rpx;
font-weight: bolder;
color: #ff0520;
line-height: 22rpx;
line-height: 33rpx;
margin-top: 36rpx;
}
}
}
......
{"version":3,"sources":["uni-app:///main.js",null,"webpack:////Users/angleterry/workspace/FuLiMini/App.vue?66af","uni-app:///App.vue","webpack:////Users/angleterry/workspace/FuLiMini/App.vue?716d","webpack:////Users/angleterry/workspace/FuLiMini/App.vue?de7a"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","Vue","config","productionTip","App","mpType","prototype","$net","net","$store","store","$router","router","$numUtils","numUtils","toast","loading","app","$mount"],"mappings":";;;;;;;;;iDAAA,wCAA8E;AAC9E;AACA;AACA;AACA;AACA;AACA;;;AAGA,qE,wnCATmBA,EAAE,CAACC,iCAAH,GAAuCC,mBAAvC;AAUnBC,aAAIC,MAAJ,CAAWC,aAAX,GAA2B,KAA3B;AACAC,aAAIC,MAAJ,GAAa,KAAb;AACAJ,aAAIK,SAAJ,CAAcC,IAAd,GAAqBC,YAArB;AACAP,aAAIK,SAAJ,CAAcG,MAAd,GAAuBC,cAAvB;AACAT,aAAIK,SAAJ,CAAcK,OAAd,GAAwBC,eAAxB;AACAX,aAAIK,SAAJ,CAAcO,SAAd,GAA0BC,gBAA1B;AACAb,aAAIK,SAAJ,CAAcS,KAAd,GAAsBA,cAAtB;AACAd,aAAIK,SAAJ,CAAcU,OAAd,GAAwBA,gBAAxB;AACA,IAAMC,GAAG,GAAG,IAAIhB,YAAJ;AACLG,YADK,EAAZ;;AAGA,UAAAa,GAAG,EAACC,MAAJ,G;;;;;;;;;;;;;;;;;ACrBA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACuD;AACL;AACa;;;AAG/D;AACuM;AACvM,gBAAgB,iNAAU;AAC1B,EAAE,yEAAM;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACe,gF;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAoxB,CAAgB,iyBAAG,EAAC,C;;;;;;;;;;;;ACCxyB,qE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAVA;;AAYA;AACA,GAjBA;AAkBA;AACA;AACA,GApBA;AAqBA;AACA;AACA,GAvBA,E;;;;;;;;;;;;ACFA;AAAA;AAAA;AAAA;AAA+mC,CAAgB,8lCAAG,EAAC,C;;;;;;;;;;ACAnoC;AACA,OAAO,KAAU,EAAE,kBAKd","file":"common/main.js","sourcesContent":["import 'uni-pages';wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;import App from './App'\nimport net from './common/net.js'\nimport store from './store/index.js'\nimport numUtils from './common/numUtil.js'\nimport router from './router/router.js'\nimport toast from './common/toast.js'\nimport loading from './common/loading.js'\n\n\nimport Vue from 'vue'\nVue.config.productionTip = false\nApp.mpType = 'app'\nVue.prototype.$net = net\nVue.prototype.$store = store\nVue.prototype.$router = router\nVue.prototype.$numUtils = numUtils\nVue.prototype.toast = toast\nVue.prototype.loading = loading\nconst app = new Vue({\n ...App\n})\napp.$mount()","var render, staticRenderFns, recyclableRender, components\nvar renderjs\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"App.vue\"\nexport default component.exports","import mod from \"-!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=script&lang=js&\"","<script>\n\timport Vue from 'vue'\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\tconsole.log('App Launch')\n\t\t\tlet that = this\n\t\t\tuni.getSystemInfo({\n\t\t\t\tsuccess: function(e) { \n\t\t\t\t\tVue.prototype.StatusBarHeight = e.statusBarHeight;\n\t\t\t\t\tlet custom = uni.getMenuButtonBoundingClientRect();\n\t\t\t\t\tVue.prototype.Custom = custom;\n\t\t\t\t\tVue.prototype.CustomBarHeight = custom.height + (custom.top - e.statusBarHeight) * 2;\n\t\t\t\t\tVue.prototype.BarPadding = custom.top;\n\t\t\t\t\tVue.prototype.SafeAreaBottom = e.safeAreaInsets.top>20 && e.platform!='android' ? 28 : 0\n\t\t\t\t\tVue.prototype.LRScreenWidth = e.screenWidth;\n\t\t\t\t\tVue.prototype.LRScreenHeight = e.screenHeight;\n\t\t\t\t}\n\t\t\t})\n\t\t\tuni.hideShareMenu({});\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n</style>\n","import mod from \"-!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=style&index=0&lang=css&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1650271692021\n var cssReload = require(\"/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"pages": [
"pages/home/home",
"pages/order/order",
"pages/mine/mine"
],
"subPackages": [
{
"root": "pagesA",
"pages": [
"login/login",
"integral/integral",
"selectAccount/selectAccount"
]
}
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#686868",
"selectedColor": "#FF0520",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/home/home",
"iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/home_h.png",
"text": "首页"
},
{
"pagePath": "pages/order/order",
"iconPath": "static/tabbar/order.png",
"selectedIconPath": "static/tabbar/order_h.png",
"text": "订单"
},
{
"pagePath": "pages/mine/mine",
"iconPath": "static/tabbar/mine.png",
"selectedIconPath": "static/tabbar/mine_h.png",
"text": "我的"
}
]
},
"preloadRule": {
"pagesA/login/login": {
"network": "all",
"packages": [
"__APP__"
]
}
},
"usingComponents": {},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"backgroundColor": "#F5F5F5",
"usingComponents": {}
}
\ No newline at end of file
<view class="container data-v-dcbcfe34"><view class="mine-header data-v-dcbcfe34"><view class="header-top data-v-dcbcfe34"><view class="nav-bar data-v-dcbcfe34" style="{{'height:'+(height+'px')+';'+('padding-top:'+(statusBarHeight+'px')+';')}}"><text class="person-center data-v-dcbcfe34">我的</text></view><view class="user-info data-v-dcbcfe34"><view class="top data-v-dcbcfe34"><image class="avator data-v-dcbcfe34" src="{{userInfo.avatar}}" mode></image><view class="info data-v-dcbcfe34"><view class="name data-v-dcbcfe34">{{userInfo.staffName}}</view><view class="shop data-v-dcbcfe34">{{userInfo.accountName}}</view></view><block wx:if="{{userInfo.allowSwitching>0}}"><view class="select-acccount data-v-dcbcfe34">切换行号<image class="img data-v-dcbcfe34" src="../../static/arrow-right-w.png" mode></image></view></block></view><view class="line data-v-dcbcfe34"></view><view class="user-integral data-v-dcbcfe34"><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.allIntegral}}</view><view class="bottom data-v-dcbcfe34">累计积分</view></view><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.surplusIntegral}}</view><view class="bottom data-v-dcbcfe34">当前积分</view></view><view class="item data-v-dcbcfe34"><view class="num data-v-dcbcfe34">{{userInfo.consumeIntegral}}</view><view class="bottom data-v-dcbcfe34">消费积分</view></view></view></view></view><view class="bottom-setting data-v-dcbcfe34"><view class="item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/coupon.png" mode></image><view class="title data-v-dcbcfe34">卡片回收</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view class="item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/integral.png" mode></image><view class="title data-v-dcbcfe34">积分明细</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view class="item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/customer.png" mode></image><view class="title data-v-dcbcfe34">联系客服</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view><view class="item last-item data-v-dcbcfe34"><view class="left data-v-dcbcfe34"><image class="left-img data-v-dcbcfe34" src="../../static/setting.png" mode></image><view class="title data-v-dcbcfe34">设置</view></view><image class="right-arrow data-v-dcbcfe34" src="../../static/arrow-right.png" mode></image></view></view></view></view>
\ No newline at end of file
{
"description": "项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"minified": true
},
"compileType": "miniprogram",
"libVersion": "",
"appid": "wxb1d546c13cb4f607",
"projectname": "FuLiMini",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment