123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <mobile-frame>
- <view class="main">
- <view class="one"></view>
- <view class="two">
- <view class="two_1">
- <view class="two_1_1">
- <text>订单状态:</text>
- <text>{{is_check}}</text>
- </view>
- <view class="two_1_1">
- <text>物流单号:</text>
- <text>{{no}}</text>
- </view>
- </view>
- <view class="two_2">
- <uni-section title="物流记录" type="line" padding>
- <uni-steps :options="list" active-color="#007AFF" :active="active" direction="column" />
- </uni-section>
- </view>
- </view>
- </view>
- </view>
- </mobile-frame>
- </template>
- <script>
- export default {
- data() {
- return {
- id: '',
- type: '',
- user: {},
- info: {},
- is_check: '',
- no: '',
- list: []
- };
- },
- onLoad: function(e) {
- const that = this;
- that.$set(that, `id`, e.id || '');
- that.$set(that, `type`, e.type || '');
- that.watchLogin()
- },
- 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.searchInfo();
- }
- })
- },
- async searchInfo() {
- const that = this;
- if (that.id) {
- let res;
- if (that.type == 'integral') {
- res = await that.$api(`/zrOrder/${that.id}`, `GET`, {}, `integral`)
- } else {
- res = await that.$api(`/orderDetail/${that.id}`, 'GET')
- }
- if (res.errcode == '0') {
- that.$set(that, `info`, res.data);
- that.search();
- } else {
- uni.showToast({
- title: res.errmsg,
- icon: 'none'
- })
- }
- }
- },
- async search() {
- const that = this;
- let res;
- if (that.type == 'integral') {
- res = await that.$api(`/zrOrder/sot/${that.info._id}`, `GET`, {}, `integral`);
- } else {
- res = await that.$api(`/orderDetail/sot/${that.info._id}`, `GET`);
- }
- if (res.errcode == '0') {
- that.$set(that, `is_check`, res.data.is_check);
- let list = res.data.list.map((i) => ({
- desc: i.time,
- title: i.context
- }))
- that.$set(that, `list`, list);
- that.$set(that, `no`, res.data.no);
- } else {
- uni.showToast({
- title: res.errmsg,
- icon: 'none'
- })
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .main {
- display: flex;
- flex-direction: column;
- width: 100vw;
- height: 100vh;
- .one {
- position: relative;
- width: 100vw;
- height: 100vh;
- background-color: #ff0000;
- }
- .two {
- position: absolute;
- bottom: 0;
- width: 92vw;
- height: 60vh;
- overflow-y: auto;
- background: #fff;
- margin: 0 2vw;
- border-top-left-radius: 5px;
- border-top-right-radius: 5px;
- padding: 2vw;
- .two_1 {
- margin: 0 0 2vw 0;
- .two_1_1 {
- padding: 1vw 0;
- }
- }
- }
- }
- .uni-section .uni-section-header {
- padding: 1vw !important;
- }
- .uni-section .uni-section-content {
- padding: 0 !important;
- }
- </style>
|