123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <template>
- <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
- <tm-menubars title="消息列表" :shadow="0" :showback="true"></tm-menubars>
- <div class="zhuti">
- <tm-sheet class="kuang" style="padding-bottom: 30px !important;" v-if="listdata.length!=0" >
- <view style="width: 94%;margin:0 auto;" class="remen">
- <view v-for="(item,index) in listdata" class="round-5 contone black mt-20" :class="index%2==0?'fl':'fr'" @click="goDetail(item.category_id)">
- <image class="logo" :src="item.image" mode="widthFix"></image>
- <view class="pa-15 text-size-s">
- <view class="text-overflow-2">
- <text class="text-size-lg">{{item.goods_name}}</text>
- <view class="text-gray mt-6">销量:{{item.stock_num}}</view>
- </view>
- <view class="mt-2 flex-between flex-center">
- <view class="touxiang mt-30">
- <text class="text-white text-size-m text-weight-b">{{item.sale_price}}</text>
- </view>
- <view >
- <image @click="jiarufuFun(item)" class="remenzan" src="/static/img/86.png" mode="widthFix"></image>
- </view>
- </view>
- </view>
- </view>
- <view style="clear: both;"></view>
- <view style="clear: both;" class="more ma-40 pt-40" @click="gengmore()" v-if="listdata.length<total" >
- <image src="/static/img/30.png" mode="widthFix"></image>
- <text class="text-size-s">下拉加载更多~</text>
- </view>
- </view>
- </tm-sheet>
- <view style="height:60px"></view>
- </div>
- <!-- 弹出层消息 -->
- <tm-message ref="toast"></tm-message>
- </view>
- </template>
- <script>
- import{myRequest} from '@/api/request.js'
- export default {
- data() {
- return {
- typeclick:1,
- listdata:[],
- soId:'',
- page:1,
- pagesize:8,
- total:0
- };
- },
- onLoad(op) {
- console.log(op);
- this.soId=op.id
- },
- created() {
- if (!uni.getStorageSync("token")) {
- uni.navigateTo({
- url: "/pages/login/index",
- })
- }
- this.sys = uni.getSystemInfoSync();
- // this.randouh()
- this.getSort()
- },
- methods: {
- gengmore(){
- this.page++;
- let that=this;
- myRequest({
- url:'/api/ShopGoods/childrenClassificationList',
- method:'post',
- data:{id:that.soId,page:that.page,pagesize:that.pagesize}
- }).then(res=>{
- if(res.data.code==200){
- if(res.data.data.length<res.data.data.total){
- console.log(res.data.data,'liebiao');
- // that.total=res.data.data.total;
- that.listdata=that.listdata.concat(res.data.data.data);
- }else{
- that.page--;
- }
- }else{
- that.$refs.toast.show({
- model: 'error',
- label: res.data.msg
- })
- }
- })
- },
- jiarufuFun(data){
- uni.navigateTo({
- url: "/pages/gouwuche/index",
- })
- // console.log(data)
- // this.gouwuche.push(data)
- },
- getSort(){
- this.page=1;
- this.pagesize=8;
- let that=this;
- myRequest({
- url:'/api/ShopGoods/childrenClassificationList',
- method:'post',
- data:{id:that.soId,page:that.page,pagesize:that.pagesize}
- }).then(res=>{
- if(res.data.code==200){
- if(res.data.data.length!=0){
- console.log(res.data.data,'liebiao');
- that.total=res.data.data.total;
- that.listdata=res.data.data.data;
- }else{
- that.listdata=[]
- }
- }else{
- that.$refs.toast.show({
- model: 'error',
- label: res.data.msg
- })
- }
- })
- },
- goindex(){
- uni.navigateBack();
- },
-
- goDetail(id){
- uni.navigateTo({
- url:'/pages/shopdetail/index?cartId='+id
- })
- },
-
- change(e){
- console.log(e)
- },
- sosoFun(){
- }
- },
- }
- </script>
- <style lang="scss">
- /deep/ .tm-menubars .body{
- background-color: #1b1b1b !important;
- }
- /deep/ .zhuti{padding: 10px 10px;}
- /deep/ .kuang{margin:0 !important;padding: 0px !important;}
- /deep/ .icon-search{
- font-size: 23px !important;
- color: #8E8E93 !important;
- }
- /deep/ .tm-search{
- width: 66%;
- background-color: #414141 !important;
- border-radius: 10px;
- }
- /deep/ .tm-search .grey-darken-5{
- background-color: #414141 !important;
- }
- .dingwei{width: 21%;margin-top:3%;}
- .shuruk{width: 77%;}
- .sousuo{width:94%;margin:0 auto;}
- .quxiao{color: #707070;line-height: 47px;}
- .contone{width: 48%;}
- .logo{width: 100%;}
- .remenzan{width: 18px !important;margin-top: 10px;}
- .more{text-align: center;}
- .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
- </style>
|