123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- <template>
- <mobile-frame>
- <view class="main">
- <view class="one">
- <input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索商品">
- </view>
- <view class="two">
- <tabs :tabs="tabs" @tabsChange="tabsChange">
- <view class="tabsList">
- <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
- <view class="list-scroll-view">
- <view class="list" v-for="(item,index) in list" :key="index">
- <view class="list_1">
- <view class="l">
- <text class="iconfont icon-shangdian"></text>
- <text>{{item.shop}}</text>
- </view>
- <view class="r">
- {{item.status=='1'?'待付款':'已付款'}}
- </view>
- </view>
- <view class="list_2">
- <view class="l">
- <image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode=""></image>
- </view>
- <view class="c">
- <view class="name">
- {{item.name}}
- </view>
- </view>
- <view class="r">
- <view class="price">
- ¥{{item.price}}
- </view>
- <view class="num">
- ×{{item.buy_num}}
- </view>
- </view>
- </view>
- <view class="other">
- <text>共{{item.market_num}}件商品</text>
- <text>总价¥{{item.money}}</text>
- </view>
- <view class="btn">
- <button type="default" size="mini">取消订单</button>
- <button type="default" size="mini">付款</button>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- <!-- <view v-show="tabs.active=='0'">全部</view>
- <view v-show="tabs.active=='1'">待付款</view>
- <view v-show="tabs.active=='2'">待发货</view>
- <view v-show="tabs.active=='3'">待收货/消费</view>
- <view v-show="tabs.active=='4'">待评价</view> -->
- </tabs>
- </view>
- <!-- <view class="one">
- <input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索商品">
- </view>
- <view class="two">
- <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
- <view class="list-scroll-view">
- <view class="two_1">
-
- </view>
- <view class="two_2">
- <view class="list" v-for="(item,index) in list" :key="index">
- <view class="list_1">
- <view class="name">
- <text @click="toDel(item)" class="iconfont icon-shangdian"></text>
- <text>{{item.shop}}</text>
- </view>
- <view class="status">{{item.status=='0'?'待付款':'已付款'}}</view>
- </view>
- <view class="list_2">
- <image class="image" :src="item.url" mode=""></image>
- <view class="other">
- <view class="name">{{item.name}}</view>
- <view class="other_1">
- 口味: {{item.num||'暂无'}}
- </view>
- </view>
- <view class="money">
- <text>¥</text>
- <text>{{item.money}}</text>
- <view class="num">
- ×{{item.num}}
- </view>
- </view>
- </view>
- <view class="list_3">
- <text>共{{item.num}}件商品</text>
- <view class="money">
- <text>总价¥</text>
- <text>{{item.money}}</text>
- </view>
- </view>
- <view class="list_4">
- <button type="default" size="mini" plain="true"
- @click="toCancel(item)">取消订单</button>
- <button type="warn" size="mini" plain="true" @click="toPay(item)">付款</button>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- </view> -->
- </view>
- </mobile-frame>
- </template>
- <script>
- import tabs from '@/components/tabs/index.vue';
- export default {
- components: {
- tabs
- },
- data() {
- return {
- user: {},
- status: '0',
- searchInfo: {},
- tabs: {
- active: '0',
- menu: [ //菜单列表
- {
- title: '全部',
- active: '0'
- },
- {
- title: '待付款',
- active: '1'
- },
- {
- title: '待发货',
- active: '2'
- },
- {
- title: '待收货/消费',
- active: '3'
- },
- {
- title: '待评价',
- active: '4'
- }
- ]
- },
- list: [ //订单列表
- {
- shop: '官方自营店',
- status: '1',
- url: [{
- name: "20220928155634.jpg",
- uri: "/files/point/20220928155634.jpg",
- url: "https://broadcast.waityou24.cn/files/point/20220928155634.jpg"
- }],
- name: '饮用水',
- price: 58,
- buy_num: 1,
- market_num: 1,
- money: 58
- }, {
- shop: '官方自营店',
- status: '1',
- url: [{
- name: "20220928155634.jpg",
- uri: "/files/point/20220928155634.jpg",
- url: "https://broadcast.waityou24.cn/files/point/20220928155634.jpg"
- }],
- name: '饮用水',
- price: 58,
- buy_num: 1,
- market_num: 1,
- money: 58
- }, {
- shop: '官方自营店',
- status: '1',
- url: [{
- name: "20220928155634.jpg",
- uri: "/files/point/20220928155634.jpg",
- url: "https://broadcast.waityou24.cn/files/point/20220928155634.jpg"
- }],
- name: '饮用水',
- price: 58,
- buy_num: 1,
- market_num: 1,
- money: 58
- }, {
- shop: '官方自营店',
- status: '1',
- url: [{
- name: "20220928155634.jpg",
- uri: "/files/point/20220928155634.jpg",
- url: "https://broadcast.waityou24.cn/files/point/20220928155634.jpg"
- }],
- name: '饮用水饮用水饮用水饮用水饮用水饮用水饮用水饮用水饮用水饮用水饮用水',
- price: 58,
- buy_num: 1,
- market_num: 1,
- money: 58
- }, {
- shop: '官方自营店',
- status: '1',
- url: [{
- name: "20220928155634.jpg",
- uri: "/files/point/20220928155634.jpg",
- url: "https://broadcast.waityou24.cn/files/point/20220928155634.jpg"
- }],
- name: '饮用水',
- price: 58,
- buy_num: 1,
- market_num: 1,
- money: 58
- }, {
- shop: '官方自营店',
- status: '1',
- url: [{
- name: "20220928155634.jpg",
- uri: "/files/point/20220928155634.jpg",
- url: "https://broadcast.waityou24.cn/files/point/20220928155634.jpg"
- }],
- name: '饮用水',
- price: 58,
- buy_num: 1,
- market_num: 1,
- money: 58
- }
- ]
- };
- },
- onLoad: function(e) {
- const that = this;
- that.$set(that, `status`, e.status);
- // 监听用户是否登录
- that.watchLogin();
- },
- onShow: function() {},
- methods: {
- // 监听用户是否登录
- watchLogin() {
- const that = this;
- uni.getStorage({
- key: 'token',
- success: function(res) {
- let user = that.$jwt(res.data);
- if (user) that.$set(that, `user`, user);
- that.$set(that.tabs, `active`, that.status);
- that.search();
- },
- fail: function(err) {
- uni.navigateTo({
- url: `/pages/login/index`
- })
- }
- });
- },
- // 查询列表
- async search() {
- const that = this;
- let user = that.user;
- let status = that.status;
- console.log(status);
- },
- // 分页
- toPage(e) {
- },
- // 输入框
- toInput(e) {
- const that = this;
- that.$set(that.searchInfo, `name`, e.detail.value)
- },
- // 取消订单
- toCancel(e) {
- console.log(e);
- },
- // 付款
- toPay(e) {
- console.log(e);
- },
- // 选择选项卡
- tabsChange(e) {
- const that = this;
- that.$set(that.tabs, `active`, e.active)
- that.$set(that, `status`, e.active);
- that.search()
- }
- }
- }
- </script>
- <style lang="scss">
- .main {
- display: flex;
- flex-direction: column;
- width: 100vw;
- height: 100vh;
- .one {
- padding: 2vw;
- input {
- padding: 2vw;
- background-color: var(--f1Color);
- font-size: var(--font14Size);
- border-radius: 5px;
- }
- }
- .two {
- position: relative;
- flex-grow: 1;
- background-color: var(--f9Color);
- .tabsList {
- position: relative;
- width: 100vw;
- height: 82vh;
- .list {
- background-color: #fff;
- margin: 0 2vw 2vw 2vw;
- padding: 2vw;
- .list_1 {
- margin: 0 0 1vw 0;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .list_2 {
- margin: 0 0 1vw 0;
- display: flex;
- .l {
- width: 20vw;
- .image {
- width: 100%;
- height: 20vw;
- border-radius: 5px;
- }
- }
- .c {
- width: 60vw;
- padding: 0 2vw;
- }
- .r {
- width: 15vw;
- text-align: right;
- }
- }
- .other {
- margin: 0 0 2vw 0;
- text-align: right;
- text {
- font-size: 14px;
- padding: 0 0 0 2vw;
- }
- }
- .btn {
- text-align: right;
- margin: 2vw 0 0 0;
- border-top: 1px solid #f1fff1;
- button {
- margin: 2vw 0 0 2vw;
- }
- }
- }
- }
- }
- }
- // .two {
- // position: relative;
- // flex-grow: 1;
- // background-color: var(--f9Color);
- // .two_1 {
- // background-color: var(--fffColor);
- // padding: 2vw;
- // display: flex;
- // flex-direction: row;
- // }
- // .two_2 {
- // display: flex;
- // flex-direction: column;
- // .list {
- // width: 100vw;
- // margin: 2vw 0 0 0;
- // background-color: var(--mainColor);
- // .list_1 {
- // display: flex;
- // flex-direction: row;
- // justify-content: space-between;
- // padding: 2vw;
- // .name {
- // font-size: var(--font14Size);
- // text {
- // margin: 0 1vw 0 0;
- // }
- // }
- // .status {
- // font-size: var(--font14Size);
- // color: var(--ff0Color);
- // }
- // }
- // .list_2 {
- // display: flex;
- // flex-direction: row;
- // justify-content: space-between;
- // padding: 2vw;
- // background-color: var(--f8Color);
- // .image {
- // width: 20vw;
- // height: 20vw;
- // margin: 0 2vw 0 0;
- // }
- // .other {
- // display: flex;
- // flex-direction: column;
- // flex-grow: 1;
- // .name {
- // font-size: var(--font14Size);
- // font-weight: bold;
- // margin: 0 0 2vw 0;
- // }
- // .other_1 {
- // font-size: var(--font12Size);
- // color: var(--f85Color);
- // }
- // }
- // .money {
- // font-size: var(--font12Size);
- // .num {
- // text-align: right;
- // }
- // }
- // }
- // .list_3 {
- // display: flex;
- // justify-content: flex-end;
- // padding: 2vw;
- // border-bottom: 0.5vw solid var(--f9Color);
- // font-size: var(--font12Size);
- // text {
- // margin: 0 1vw;
- // }
- // }
- // .list_4 {
- // padding: 2vw;
- // text-align: right;
- // button {
- // margin: 0 1vw 0 2vw;
- // }
- // }
- // }
- // }
- // }
- // }
- .scroll-view {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- .list-scroll-view {
- display: flex;
- flex-direction: column;
- }
- }
- </style>
|