index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  1. <template>
  2. <view class="container" :data-theme="theme">
  3. <!-- :style="userInfo.avatar?{ backgroundImage: `url(${userInfo.avatar})` }: ''" -->
  4. <!-- #ifdef MP || APP -->
  5. <NavBar navTitle="个人主页" :isBackgroundColor="false" iconColor='#fff'></NavBar>
  6. <!-- #endif -->
  7. <view class="header">
  8. <view class="header-bg" :style="{'background-image': userInfo.avatar}">
  9. <img :src="userInfo.avatar" alt="">
  10. <view class="header-bg-mc"></view>
  11. </view>
  12. <view class="user_wrapper flex-between-center">
  13. <image v-if="userInfo.userLevelIcon" class="level_icon" :src="userInfo.userLevelIcon" alt="">
  14. <view class="flex-y-center row-middle">
  15. <image :src="userInfo.avatar || urlDomain+'crmebimage/presets/morenT.png'" class="picture">
  16. </image>
  17. <view class="user_text flex-1">
  18. <view class="name acea-row">
  19. <text>{{userInfo.isLogoff ? "用户已注销": (userInfo.nickname || '')}}</text>
  20. </view>
  21. <!-- <view v-if="userInfo.id" class="user_id">ID: {{userInfo.id || ''}}</view> -->
  22. <view class="flex-between-center mt-16" @click="onEdit('school')">
  23. <view class="user_id">学校: {{school || '暂无'}}</view>
  24. <text v-show="userInfo.id==uid" class="ml10 iconfont icon-fabuzhongcao"></text>
  25. </view>
  26. </view>
  27. </view>
  28. <view v-if="id && id!=uid" @click.stop="followAuthor">
  29. <button v-if="!userInfo.isConcerned" class="follow_btn focus">
  30. <text class="iconfont icon-jiahao2"></text>关注
  31. </button>
  32. <button v-else class="follow_btn focused">已关注</button>
  33. </view>
  34. <view v-if="userInfo.id==uid">
  35. <navigator hover-class="none" :url="`/pages/discover/discover_release/index?fair=${true}`" class="follow_btn focus bg-color">
  36. 去发布
  37. </navigator>
  38. </view>
  39. </view>
  40. <view class="acea-row plant_info" @click="onEdit('signature')">
  41. <view v-if="!userInfo.signature && userInfo.id==uid">点击可编辑个性签名</view>
  42. <view class="" v-if="userInfo.signature" style="width: 92%;">
  43. <view class="acea-row" v-if="userInfo.isMore || userInfo.signature.length<=30">
  44. <text class="signature">{{userInfo.signature}}</text>
  45. <text v-if="userInfo.isMore" class="more" @click.stop="moreTap">收起</text>
  46. </view>
  47. <view v-else class="acea-row">
  48. <text class="info signature">{{userInfo.signature.slice(0,23)}}...</text>
  49. <text class="more" @click.stop="moreTap"> 展开</text>
  50. </view>
  51. </view>
  52. <text v-show="userInfo.id==uid" class="ml10 iconfont icon-fabuzhongcao"></text>
  53. </view>
  54. <view class="plant_info" style="padding-bottom: 30rpx;">
  55. <view class="count_wrapper acea-row">
  56. <!-- <navigator :url="!id ? '/pages/discover/discover_follow/index?type=follow' : ''" class="item" hover-class="none">
  57. <text class="mr10">{{userInfo.concernedNum}}</text> 关注
  58. </navigator>
  59. <navigator :url="!id ? '/pages/discover/discover_follow/index?type=fans' : ''" class="item" hover-class="none">
  60. <text class="mr10">{{userInfo.fansNum}}</text> 粉丝
  61. </navigator>
  62. <view class="item">
  63. <text class="mr10">{{userInfo.likeNum}}</text> 获赞
  64. </view> -->
  65. <!--navigator v-if="userInfo.id==uid" :url="!id ? '/pages/goods/order_list/index?orderType=secondHand' : ''" class="item" hover-class="none">
  66. <text class="mr10"></text> 我的订单
  67. </navigator-->
  68. <navigator v-if="userInfo.id==uid" :url="!id ? '/pages/goods/order_list/index?orderType=secondHand&status=0' : ''" class="item" hover-class="none">
  69. <text class="mr10">{{myOrder.awaitPayCount}}</text>待付款
  70. </navigator>
  71. <navigator v-if="userInfo.id==uid" :url="!id ? '/pages/goods/order_list/index?orderType=secondHand&status=1' : ''" class="item" hover-class="none">
  72. <text class="mr10">{{myOrder.awaitShippedCount}}</text>待发货
  73. </navigator>
  74. <navigator v-if="userInfo.id==uid" :url="!id ? '/pages/goods/order_list/index?orderType=secondHand&status=4' : ''" class="item" hover-class="none">
  75. <text class="mr10">{{myOrder.receiptCount}}</text>待收货
  76. </navigator>
  77. <navigator v-if="userInfo.id==uid" :url="!id ? '/pages/trade_fair/trade_return_list/index' : ''" class="item" hover-class="none">
  78. <text class="mr10">{{userInfo.refundNum}}</text> 售后/退款
  79. </navigator>
  80. </view>
  81. </view>
  82. <view v-if="!id && isShow" class="tab_count relative">
  83. <scroll-view :scroll-x="true" scroll-with-animation style="white-space: nowrap;margin: 20rpx 0rpx;padding: 0 20rpx;box-sizing: border-box;">
  84. <block>
  85. <text @click.stop="changeTab(0)" :class="tab==0 ? 'on' : ''">我发布的</text>
  86. <text @click.stop="changeTab(1)" :class="tab==1 ? 'on' : ''">我想要的</text>
  87. <text @click.stop="changeTab(2)" :class="tab==2 ? 'on' : ''">我收藏的</text>
  88. <text @click.stop="changeTab(3)" :class="tab==3 ? 'on' : ''">我购买的</text>
  89. <!-- <text @click.stop="changeTab(4)" :class="tab==4 ? 'on' : ''">售后/退款</text> -->
  90. </block>
  91. </scroll-view>
  92. </view>
  93. </view>
  94. <view class="main">
  95. <view class="tab-conts">
  96. <view v-if="list.length > 0 && tab!==3 && tab!==4" class="goods-wrap flex-1">
  97. <view class="goods">
  98. <!-- <WaterfallsFlow v-if="list.length" :wfList="list" :fromType="1" fromTo="home">
  99. </WaterfallsFlow> -->
  100. <WaterfallsFlow :wfList='list' :type="1" :isDynamics="true" :userFair="true" :isManage="manage">
  101. <template slot-scope="{item}">
  102. <WaterfallsFlowItem :item="item" :type="1" :isStore="1" />
  103. </template>
  104. </WaterfallsFlow>
  105. </view>
  106. </view>
  107. <view class='my-order' v-else-if="tab == 3">
  108. <view class='list'>
  109. <view class='item' v-for="(item,index) in list" :key="index">
  110. <view class='title acea-row row-between-wrapper'>
  111. <view class="acea-row row-middle">
  112. <view v-if="item.merName">
  113. <navigator :url="`/pages/merchant/home/index?merId=${item.merId}`" hover-class="none">
  114. <text class='iconfont icon-shangjiadingdan mr10'></text>
  115. <text class="mr10">{{item.merName}}</text>
  116. <text class='iconfont icon-xiangyou'></text>
  117. </navigator>
  118. </view>
  119. <view v-else>
  120. <text class="mr10">{{item.orderNo}}</text>
  121. </view>
  122. </view>
  123. <view v-if="item.refundStatus == 3" class='font_color'>已退款</view>
  124. <template v-else>
  125. <view class='font_color'>{{item.status | orderStatusFilter}}</view>
  126. </template>
  127. </view>
  128. <view v-for="(items,indexs) in item.orderInfoList" :key="indexs">
  129. <view @click='goOrderDetails(item)' class='item-info acea-row row-between row-top'>
  130. <view class='pictrue'>
  131. <easy-loadimage mode="widthFix" :image-src="items.image"></easy-loadimage>
  132. </view>
  133. <view class='text acea-row row-between'>
  134. <view class="nameBox">
  135. <view class='name line2'>
  136. <span v-if="Number(item.type) > 0 && Number(item.type) < 3" class="activity bg_color">{{item.type | orderTypeFilter}}</span>
  137. <span v-if="Number(item.secondType) === 1" class="activity bg_color">积分</span>
  138. <span>{{items.productName}}</span>
  139. </view>
  140. <view class="sku line1">{{items.sku}}</view>
  141. </view>
  142. <view class='money'>
  143. <view>¥{{items.price}}</view>
  144. <view>x{{items.payNum}}</view>
  145. </view>
  146. </view>
  147. </view>
  148. <view v-if="items.applyRefundNum && item.refundStatus > -1" class="text-24rpx font-color oppoSans-R mr-20px px-30 mt-14">
  149. 售后申请数量:{{ items.applyRefundNum }}
  150. </view>
  151. </view>
  152. <view class='totalPrice' :class="item.status===0?'no-border':''">{{item.totalNum}}
  153. 件商品,总金额
  154. <text class='money semiBold'> ¥{{item.payPrice}}</text>
  155. </view>
  156. <!-- <view v-if="item.status===0" class="mx-20 flex">
  157. <view class="tips w-full px-20 f-s-26">
  158. 付款提醒<text class="ml-20 text-999">请在{{item.expirationTime}}前完成支付!</text>
  159. </view>
  160. </view> -->
  161. <!-- 订单状态(0:待支付,1:待发货,2:部分发货, 3:待核销,4:待收货,5:已收货,6:已完成,9:已取消) -->
  162. <view class='bottom acea-row row-right row-middle'>
  163. <view class='bnt cancelBnt' v-if="item.status === 0" @click='cancelOrder(index,item.orderNo)'>
  164. 取消订单
  165. </view>
  166. <view class='bnt bg_color' v-if="item.status === 0" @click='goPay(item)'>
  167. 立即付款
  168. </view>
  169. <view class='bnt bg_color' v-if="((item.paid || item.status == 9)&&item.type!=2)||(item.type==2&&item.groupBuyRecordStatus!==0)"
  170. @click='goOrderDetails(item)'>
  171. 查看详情</view>
  172. <view class='bnt cancelBnt' v-if="item.status==6 || item.status==9" @click='delOrder(item.orderNo,index)'>
  173. 删除订单
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <view class="empty-boxs noContent" v-if="list.length == 0 && !loading">
  180. <emptyPage title="暂无更多内容~" mTop="13%" :imgSrc="urlDomain+'crmebimage/presets/noguanzhu.png'">
  181. </emptyPage>
  182. </view>
  183. <view class='loadingicon acea-row row-center-wrapper'>
  184. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
  185. <view class="end" :hidden="loading || list.length == 0"><text :class="loaded ? 'loaded' : ''">{{loadTitle}}</text>
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. <uni-popup ref="inputDialog" type="dialog">
  191. <view v-if="isShowSignature" class="tui-modal-custom">
  192. <view class="fs-32 fw-500 lh-44rpx text-center">{{fieldStr == 'signature' ? '编辑简介' : '编辑学校'}}</view>
  193. <view class="mt-24 bg--w111-f5f5f5 rd-16rpx p-24">
  194. <textarea v-if="fieldStr == 'signature'" class="w-full fs-26 h-342" ref="myTextarea" v-model="signature" :focus="focus"
  195. :always-embed="true" :adjust-position="true" cursor-spacing="85rpx" placeholder="请输入内容" :maxlength="100" name="desc" />
  196. <input v-if="fieldStr == 'school'" class="placeholder" type='text' v-model='school' :focus="focus"
  197. placeholder='请输入学校' placeholder-class='placeholder'></input>
  198. </view>
  199. <view class="flex-between-center mt-40">
  200. <view class="w-244 h-72 rd-36rpx flex-center fs-26 font-color close-btn" @tap="handleInputClose">取消
  201. </view>
  202. <view class="w-244 h-72 rd-36rpx flex-center bg-color text--w111-fff fs-26"
  203. @tap="handleInputConfirm">保存
  204. </view>
  205. </view>
  206. </view>
  207. </uni-popup>
  208. </view>
  209. </template>
  210. <script>
  211. // +----------------------------------------------------------------------
  212. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  213. // +----------------------------------------------------------------------
  214. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  215. // +----------------------------------------------------------------------
  216. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  217. // +----------------------------------------------------------------------
  218. // | Author: CRMEB Team <admin@crmeb.com>
  219. // +----------------------------------------------------------------------
  220. import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
  221. import WaterfallsFlowItem from '@/components/discoverFlowItem/discoverFlowItem.vue'
  222. import emptyPage from '@/components/emptyPage.vue';
  223. import NavBar from '@/components/navBar.vue';
  224. //import PriceChange from '@/components/PriceChange/index.vue'
  225. import {
  226. userHomeApi,
  227. myHomeApi,
  228. authorNoteApi,
  229. mySecondHandListApi,
  230. myLikeListApi,
  231. secondHandListApi,
  232. secondHandFollowListApi,
  233. editSignatureApi,
  234. editSchoolApi,
  235. secondHandOrderApi
  236. } from '@/api/discover.js';
  237. import {
  238. getSecondHandDetail,
  239. secondHandTake,
  240. secondHandDel,
  241. secondHandCancel,
  242. secondHandStatusImgApi,
  243. secondHandSend,
  244. secondHandOrderList,
  245. refundSecondHandList
  246. } from '@/api/secondHand.js';
  247. import {
  248. ProductTypeEnum,
  249. } from "@/enums/productEnums";
  250. import {
  251. Debounce
  252. } from '@/utils/validate.js';
  253. import {
  254. toLogin
  255. } from '@/libs/login.js';
  256. import {
  257. mapGetters
  258. } from "vuex";
  259. import {
  260. discoverFollowAuthor
  261. } from '@/libs/follow.js';
  262. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  263. const app = getApp();
  264. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  265. export default {
  266. components: {
  267. WaterfallsFlow,
  268. WaterfallsFlowItem,
  269. emptyPage,
  270. NavBar,
  271. easyLoadimage,
  272. //PriceChange
  273. },
  274. data() {
  275. return {
  276. sysHeight: sysHeight,
  277. urlDomain: this.$Cache.get("imgHost"),
  278. theme: app.globalData.theme,
  279. ProductTypeEnum: ProductTypeEnum,
  280. list: [], // 内容列表
  281. loadTitle: '加载更多',
  282. loading: false,
  283. loaded: false,
  284. isShowAuth: false, //是否隐藏授权
  285. isAuto: false, //没有授权的不会自动授权
  286. userInfo: {},
  287. myOrder: {},
  288. where: {
  289. page: 1,
  290. limit: 10
  291. },
  292. tab: 0,
  293. id: '', //作者id
  294. isShow: false,
  295. focus: false,
  296. isShowSignature: false, // 是否显示简介编辑内容
  297. signature: '', //弹窗中的签名
  298. school: '',
  299. fieldStr: '',
  300. manage: 1
  301. }
  302. },
  303. created() {},
  304. computed: {
  305. ...mapGetters(['isLogin', 'uid']),
  306. },
  307. watch: {},
  308. onLoad: function(options) {
  309. this.id = options.id ? options.id : '';
  310. },
  311. onShow() {
  312. // if (this.id) {
  313. // this.isShow = false
  314. // this.getUserHome(this.id);
  315. // this.authorNoteList();
  316. // } else {
  317. this.isShow = true
  318. this.getMyHome();
  319. this.myNoteList();
  320. this.getMyOrder();
  321. // }
  322. },
  323. onReady() {},
  324. mounted: function() {},
  325. methods: {
  326. moreTap() {
  327. this.$set(this.userInfo, 'isMore', !this.userInfo.isMore)
  328. },
  329. //个性签名取消
  330. handleInputClose() {
  331. this.$refs.inputDialog.close()
  332. this.isShowSignature = false;
  333. },
  334. //个性签名保存
  335. handleInputConfirm() {
  336. const api = this.fieldStr == 'signature' ? editSignatureApi({signature: this.signature}) : editSchoolApi({school: this.school});
  337. api.then(res => {
  338. uni.showToast({
  339. title: res.data,
  340. icon: 'none'
  341. })
  342. this.getMyHome();
  343. }).catch(err => {
  344. uni.showToast({
  345. title: err,
  346. icon: 'none'
  347. })
  348. });
  349. // 关闭窗口后,恢复默认内容
  350. this.$refs.inputDialog.close()
  351. this.isShowSignature = false;
  352. },
  353. //编辑个性签名
  354. onEdit(str) {
  355. if (this.userInfo.id == this.uid) {
  356. this.fieldStr = str;
  357. this.isShowSignature = true;
  358. this.signature = this.userInfo.signature;
  359. this.$refs.inputDialog.open();
  360. }
  361. },
  362. //回退页面之后重新加载页面
  363. reFresh() {
  364. this.loading = false;
  365. this.loaded = false;
  366. this.where = {
  367. page: 1,
  368. limit: 10
  369. }
  370. this.list = []
  371. // if (this.id) {
  372. // this.getUserHome(this.id);
  373. // this.authorNoteList();
  374. // } else {
  375. this.getMyHome();
  376. this.myNoteList();
  377. this.getMyOrder();
  378. // }
  379. },
  380. //获取我的用户信息
  381. getMyHome() {
  382. myHomeApi().then(res => {
  383. console.log(res.data)
  384. this.userInfo = res.data;
  385. this.signature = this.userInfo.signature
  386. this.school = this.userInfo.school
  387. this.isMore = false;
  388. }).catch(err => {
  389. uni.showToast({
  390. title: err,
  391. icon: 'none'
  392. })
  393. });
  394. },
  395. //获取我的用户信息
  396. getMyOrder() {
  397. secondHandOrderApi().then(res => {
  398. console.log(res.data)
  399. this.myOrder = res.data;
  400. this.isMore = false;
  401. }).catch(err => {
  402. uni.showToast({
  403. title: err,
  404. icon: 'none'
  405. })
  406. });
  407. },
  408. /**
  409. * 去订单详情
  410. */
  411. goOrderDetails: function(item, status) {
  412. if (!item.orderNo) return this.$util.Tips({
  413. title: '缺少订单号无法查看订单详情'
  414. });
  415. //虚拟商品
  416. if (item.secondType === this.ProductTypeEnum.CloudDrive || item.secondType === this.ProductTypeEnum
  417. .CardPassword) {
  418. // #ifdef MP
  419. uni.navigateTo({
  420. url: '/pages/goods/virtual_order_details/index?orderNo=' + item.orderNo
  421. })
  422. // #endif
  423. // #ifndef MP
  424. uni.navigateTo({
  425. animationType: animationType.type,
  426. animationDuration: animationType.duration,
  427. url: '/pages/goods/virtual_order_details/index?orderNo=' + item.orderNo
  428. })
  429. // #endif
  430. } else {
  431. // #ifdef MP
  432. uni.navigateTo({
  433. url: '/pages/goods/order_details/index?orderNo=' + item.orderNo + '&orderType=secondHand'
  434. })
  435. // #endif
  436. // #ifndef MP
  437. uni.navigateTo({
  438. animationType: animationType.type,
  439. animationDuration: animationType.duration,
  440. url: '/pages/goods/order_details/index?orderNo=' + item.orderNo + "'&orderType=secondHand'
  441. })
  442. // #endif
  443. }
  444. },
  445. //逛逛用户主页
  446. getUserHome(id) {
  447. userHomeApi(id).then(res => {
  448. this.userInfo = res.data
  449. }).catch(err => {
  450. uni.showToast({
  451. title: err,
  452. icon: 'none'
  453. })
  454. });
  455. },
  456. // 关注作者
  457. followAuthor: function() {
  458. if (this.isLogin) {
  459. if (this.userInfo.isLogoff) return;
  460. discoverFollowAuthor(this.id).then(() => {
  461. this.$set(this.userInfo, 'isConcerned', !this.userInfo.isConcerned);
  462. });
  463. } else {
  464. toLogin();
  465. }
  466. },
  467. changeTab(tab) {
  468. this.tab = tab
  469. this.where.page = 1
  470. this.loaded = this.loading = false
  471. this.list = []
  472. if (tab === 0) {
  473. this.manage = 1;
  474. this.myNoteList();
  475. } else if (tab === 1) {
  476. this.manage = 0;
  477. this.myLikeList();
  478. } else if (tab === 2) {
  479. this.manage = 0;
  480. this.myFollowList()
  481. } else if (tab === 3) {
  482. this.manage = 0;
  483. this.myOrderList()
  484. } else {
  485. this.manage = 0;
  486. this.mySaleList()
  487. }
  488. },
  489. // 获取售后/退款
  490. mySaleList: function() {
  491. let that = this;
  492. if (that.loaded || that.loading) return;
  493. that.loading = true;
  494. that.loadTitle = '';
  495. refundSecondHandList(that.where).then(res => {
  496. let list = res.data.list;
  497. let goods = that.$util.SplitArray(list, that.list);
  498. that.loaded = list.length < that.where.limit;
  499. that.loading = false;
  500. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  501. that.$set(that, 'list', goods);
  502. that.$set(that.where, 'page', that.where.page + 1);
  503. }).catch(err => {
  504. that.loading = false;
  505. uni.showToast({
  506. title: err,
  507. icon: 'none'
  508. })
  509. })
  510. },
  511. // 获取我购买的作品
  512. myOrderList: function() {
  513. let that = this;
  514. if (that.loaded || that.loading) return;
  515. that.loading = true;
  516. that.loadTitle = '';
  517. that.where.status = -1;
  518. secondHandOrderList(that.where).then(res => {
  519. let list = res.data.list;
  520. let goods = that.$util.SplitArray(list, that.list);
  521. that.loaded = list.length < that.where.limit;
  522. that.loading = false;
  523. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  524. that.$set(that, 'list', goods);
  525. that.$set(that.where, 'page', that.where.page + 1);
  526. }).catch(err => {
  527. that.loading = false;
  528. uni.showToast({
  529. title: err,
  530. icon: 'none'
  531. })
  532. })
  533. },
  534. // 获取我的收藏作品
  535. myFollowList: function() {
  536. let that = this;
  537. if (that.loaded || that.loading) return;
  538. that.loading = true;
  539. that.loadTitle = '';
  540. secondHandFollowListApi(that.where).then(res => {
  541. let list = res.data.list;
  542. let goods = that.$util.SplitArray(list, that.list);
  543. that.loaded = list.length < that.where.limit;
  544. that.loading = false;
  545. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  546. that.$set(that, 'list', goods);
  547. that.$set(that.where, 'page', that.where.page + 1);
  548. }).catch(err => {
  549. that.loading = false;
  550. uni.showToast({
  551. title: err,
  552. icon: 'none'
  553. })
  554. })
  555. },
  556. // 获取我的点赞作品
  557. myLikeList: function() {
  558. let that = this;
  559. if (that.loaded || that.loading) return;
  560. that.loading = true;
  561. that.loadTitle = '';
  562. secondHandListApi(that.where).then(res => {
  563. let list = res.data.list;
  564. let goods = that.$util.SplitArray(list, that.list);
  565. that.loaded = list.length < that.where.limit;
  566. that.loading = false;
  567. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  568. that.$set(that, 'list', goods);
  569. that.$set(that.where, 'page', that.where.page + 1);
  570. }).catch(err => {
  571. that.loading = false;
  572. uni.showToast({
  573. title: err,
  574. icon: 'none'
  575. })
  576. })
  577. },
  578. // 获取我的的作品
  579. myNoteList: function() {
  580. let that = this;
  581. if (that.loaded || that.loading) return;
  582. that.loading = true;
  583. that.loadTitle = '';
  584. mySecondHandListApi(that.where).then(res => {
  585. let list = res.data.list;
  586. let goods = that.$util.SplitArray(list, that.list);
  587. that.loaded = list.length < that.where.limit;
  588. that.loading = false;
  589. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  590. that.$set(that, 'list', goods);
  591. that.$set(that.where, 'page', that.where.page + 1);
  592. }).catch(err => {
  593. that.loading = false;
  594. uni.showToast({
  595. title: err,
  596. icon: 'none'
  597. })
  598. })
  599. },
  600. // 作者的作品
  601. authorNoteList: function() {
  602. let that = this;
  603. if (that.loaded || that.loading) return;
  604. that.loading = true;
  605. that.loadTitle = '';
  606. this.where.authorId = this.id
  607. authorNoteApi(this.where.authorId, that.where).then(res => {
  608. let list = res.data.list;
  609. let goods = that.$util.SplitArray(list, that.list);
  610. that.loaded = list.length < that.where.limit;
  611. that.loading = false;
  612. that.loadTitle = that.loaded ? '到底了' : '加载更多';
  613. that.$set(that, 'list', goods);
  614. that.$set(that.where, 'page', that.where.page + 1);
  615. }).catch(err => {
  616. that.loading = false;
  617. uni.showToast({
  618. title: err,
  619. icon: 'none'
  620. })
  621. })
  622. },
  623. /**
  624. * 取消订单
  625. *
  626. */
  627. cancelOrder: function(index, orderNo) {
  628. let that = this;
  629. if (!orderNo) return that.$util.Tips({
  630. title: '缺少订单号无法取消订单'
  631. });
  632. uni.showModal({
  633. content: '确定取消该订单',
  634. cancelText: "取消",
  635. confirmText: "确定",
  636. showCancel: true,
  637. confirmColor: '#f55850',
  638. success: (res) => {
  639. if (res.confirm) {
  640. uni.showLoading({
  641. title: '正在取消中'
  642. });
  643. secondHandCancel(orderNo).then(res => {
  644. uni.hideLoading();
  645. return that.$util.Tips({
  646. title: '取消成功',
  647. icon: 'success'
  648. }, function() {
  649. that.getAllOrder();
  650. });
  651. }).catch(err => {
  652. return that.$util.Tips({
  653. title: err
  654. });
  655. });
  656. } else {
  657. }
  658. },
  659. })
  660. },
  661. /**
  662. * 打开支付组件
  663. *
  664. */
  665. goPay: Debounce(function(item) {
  666. uni.showLoading({
  667. title: '加载中...'
  668. });
  669. // 其他商品走正常流程,去支付收银台页面
  670. this.getToPayment('', item, 'secondHand')
  671. }),
  672. /**
  673. * 删除订单
  674. */
  675. delOrder: function(orderNo, index) {
  676. uni.showModal({
  677. content: '确定删除该订单',
  678. cancelText: "取消",
  679. confirmText: "确定",
  680. showCancel: true,
  681. confirmColor: '#f55850',
  682. success: (res) => {
  683. if (res.confirm) {
  684. let that = this;
  685. secondHandDel(orderNo).then(res => {
  686. that.getAllOrder();
  687. return that.$util.Tips({
  688. title: '删除成功',
  689. icon: 'success'
  690. });
  691. }).catch(err => {
  692. return that.$util.Tips({
  693. title: err
  694. });
  695. })
  696. } else {
  697. }
  698. },
  699. })
  700. },
  701. //撤销售后
  702. handleRevokeRefund(refundOrderNo) {
  703. onRevokeRefund(refundOrderNo, 'secondHand').then(() => {
  704. this.changeTab(4)
  705. });
  706. },
  707. //退回商品
  708. handleReturningRefund(item) {
  709. this.$Cache.set('productInfo', item)
  710. uni.navigateTo({
  711. url: `/pages/goods/returns_and_refunds/index?refundOrderNo=${item.refundOrderNo}&returnGoodsType=${item.returnGoodsType}&orderType=secondHand`
  712. })
  713. },
  714. },
  715. onReachBottom() {
  716. // if (this.id) {
  717. // this.authorNoteList();
  718. // } else {
  719. if (this.tab === 0) {
  720. this.myNoteList();
  721. } else {
  722. this.myLikeList();
  723. }
  724. // }
  725. },
  726. onPullDownRefresh() {},
  727. // 滚动监听
  728. onPageScroll(e) {
  729. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  730. uni.$emit('scroll');
  731. }
  732. }
  733. </script>
  734. <style lang="scss" scoped>
  735. .close-btn {
  736. @include coupons_border_color(theme);
  737. }
  738. .tui-modal-custom {
  739. width: 600rpx;
  740. position: relative;
  741. box-sizing: border-box;
  742. padding: 40rpx;
  743. border-radius: 16px;
  744. background-color: #fff;
  745. z-index: 9999;
  746. .h-342 {
  747. min-height: 268rpx;
  748. max-height: 268rpx;
  749. ;
  750. overflow-y: scroll;
  751. }
  752. }
  753. .signature {
  754. overflow: hidden;
  755. display: -webkit-box;
  756. -webkit-line-clamp: 5;
  757. -webkit-box-orient: vertical;
  758. text-overflow: ellipsis;
  759. width: 88%;
  760. }
  761. .goods-wrap {
  762. padding-top: 24rpx;
  763. }
  764. .more {
  765. font-weight: 600;
  766. margin-left: 8rpx;
  767. }
  768. .container {
  769. background: #ffffff;
  770. min-height: 100vh;
  771. }
  772. .header-bg {
  773. position: absolute;
  774. width: 100%;
  775. height: 650rpx;
  776. top: 0;
  777. /* #ifdef MP || APP-PLUS */
  778. z-index: -1;
  779. /* #endif */
  780. /* #ifdef H5 */
  781. z-index: 0;
  782. /* #endif */
  783. z-index: 0;
  784. filter: blur(0);
  785. overflow: hidden;
  786. img {
  787. width: 100%;
  788. height: 100%;
  789. filter: blur(16rpx);
  790. transform: scale(1.5);
  791. }
  792. .header-bg-mc {
  793. position: absolute;
  794. top: 0;
  795. width: 100%;
  796. height: 100%;
  797. background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.1) 39%, rgba(0, 0, 0, 0.7) 100%);
  798. }
  799. }
  800. .header {
  801. width: 750rpx;
  802. padding: 20rpx 0 0;
  803. box-sizing: border-box;
  804. background: linear-gradient(360deg, #72798E 0%, #384857 99%);
  805. opacity: 1;
  806. .tab_count {
  807. text-align: center;
  808. background: #ffffff;
  809. padding: 30rpx 0 15rpx 0;
  810. border-radius: 12px 12px 0 0;
  811. text {
  812. display: inline-block;
  813. font-size: 28rpx;
  814. color: #999999;
  815. margin: 0 30rpx;
  816. position: relative;
  817. padding-bottom: 14rpx;
  818. &.on {
  819. font-size: 32rpx;
  820. color: #282828;
  821. font-weight: bold;
  822. &::after {
  823. content: "";
  824. width: 80%;
  825. height: 5rpx;
  826. @include main_bg_color(theme);
  827. position: absolute;
  828. bottom: 0;
  829. left: 12rpx;
  830. }
  831. .underline {
  832. opacity: 1;
  833. }
  834. }
  835. }
  836. }
  837. .user_wrapper {
  838. align-items: center;
  839. justify-content: space-between;
  840. padding: 0 34rpx;
  841. position: relative;
  842. .level_icon {
  843. position: absolute;
  844. width: 38rpx;
  845. height: 38rpx;
  846. margin: 4rpx 0 0 6rpx;
  847. border: none;
  848. z-index: 11;
  849. bottom: 2rpx;
  850. left: 124rpx;
  851. }
  852. .image,
  853. uni-image,
  854. image {
  855. width: 140rpx;
  856. height: 140rpx;
  857. border-radius: 100%;
  858. border: 4rpx solid #ffffff;
  859. }
  860. .user_text {
  861. margin-left: 30rpx;
  862. color: #FFFFFF;
  863. .name {
  864. font-size: 34rpx;
  865. font-weight: bold;
  866. align-items: center;
  867. }
  868. .user_id {
  869. text-overflow: ellipsis;
  870. white-space: nowrap;
  871. overflow: hidden;
  872. max-width: 300rpx;
  873. font-size: 24rpx;
  874. }
  875. }
  876. }
  877. .plant_info {
  878. position: relative;
  879. padding: 0 34rpx;
  880. margin-top: 30rpx;
  881. justify-content: space-between;
  882. color: #ffffff;
  883. font-size: 24rpx;
  884. .count_wrapper {
  885. color: #FFFFFF;
  886. font-size: 24rpx;
  887. .item {
  888. text-align: center;
  889. margin-right: 60rpx;
  890. &:last-child {
  891. margin-right: 0;
  892. }
  893. text {
  894. font-size: 30rpx;
  895. margin-top: 10rpx;
  896. }
  897. }
  898. }
  899. }
  900. .iconfont {
  901. font-size: 24rpx;
  902. margin-right: 12rpx;
  903. }
  904. .follow_btn {
  905. color: #ffffff;
  906. font-size: 26rpx;
  907. display: flex;
  908. align-items: center;
  909. justify-content: center;
  910. width: 146rpx;
  911. height: 62rpx;
  912. @include linear-gradient(theme);
  913. border-radius: 33rpx;
  914. .icon-fabu {
  915. font-size: 24rpx;
  916. }
  917. &.focused {
  918. background: transparent;
  919. color: #FFFFFF;
  920. border: 1px solid #FFFFFF;
  921. }
  922. }
  923. }
  924. .main {
  925. background: #ffffff;
  926. position: relative;
  927. }
  928. .goods {
  929. // display: flex;
  930. // flex-wrap: wrap;
  931. // justify-content: space-between;
  932. // width: 750rpx;
  933. padding: 0 24rpx;
  934. }
  935. .empty {
  936. margin: 130rpx 0 150rpx;
  937. text-align: center;
  938. image,
  939. uni-image {
  940. display: inline-block;
  941. width: 414rpx;
  942. height: 305rpx;
  943. }
  944. text {
  945. display: block;
  946. color: #999999;
  947. font-size: 26rpx;
  948. }
  949. }
  950. .end {
  951. margin-top: 50rpx 0;
  952. text-align: center;
  953. text {
  954. color: #999999;
  955. font-size: 22rpx;
  956. position: relative;
  957. &.loaded {
  958. &::before,
  959. &::after {
  960. content: "";
  961. display: inline-block;
  962. width: 22rpx;
  963. height: 1rpx;
  964. background: #999999;
  965. position: absolute;
  966. top: 18rpx;
  967. opacity: .5;
  968. }
  969. &::before {
  970. left: -30rpx;
  971. }
  972. &::after {
  973. right: -30rpx;
  974. }
  975. }
  976. }
  977. }
  978. .my-order .list {
  979. width: 690rpx;
  980. margin: 0 auto;
  981. }
  982. .my-order .list .item {
  983. background-color: #fff;
  984. border-radius: 14rpx;
  985. margin-bottom: 14rpx;
  986. }
  987. .my-order .list .item .title {
  988. height: 84rpx;
  989. padding: 0 24rpx;
  990. border-bottom: 1rpx solid #eee;
  991. font-size: 28rpx;
  992. color: #282828;
  993. }
  994. .my-order .list .item .title .sign {
  995. font-size: 24rpx;
  996. padding: 0 13rpx;
  997. height: 36rpx;
  998. margin-right: 15rpx;
  999. border-radius: 18rpx;
  1000. @include coupons_border_color(theme);
  1001. @include main_color(theme);
  1002. }
  1003. .my-order .list .item .item-info {
  1004. padding: 0 30rpx;
  1005. margin-top: 22rpx;
  1006. }
  1007. .my-order .list .item .item-info .pictrue {
  1008. width: 120rpx;
  1009. height: 120rpx;
  1010. }
  1011. .my-order .list .item .item-info .pictrue image {
  1012. width: 100%;
  1013. height: 100%;
  1014. border-radius: 14rpx;
  1015. overflow: hidden;
  1016. }
  1017. .my-order .list .item .item-info {
  1018. .nameBox {
  1019. position: relative;
  1020. height: 120rpx;
  1021. }
  1022. .sku {
  1023. font-size: 20rpx;
  1024. position: absolute;
  1025. bottom: 4rpx;
  1026. width: 420rpx;
  1027. }
  1028. .text {
  1029. width: 496rpx;
  1030. font-size: 28rpx;
  1031. color: #999;
  1032. }
  1033. }
  1034. .my-order .list .item .item-info .text .name {
  1035. width: 326rpx;
  1036. color: #282828;
  1037. }
  1038. .my-order .list .item .item-info .text .money {
  1039. text-align: right;
  1040. }
  1041. .font_color {
  1042. @include main_color(theme);
  1043. }
  1044. .my-order .list .item .totalPrice {
  1045. font-size: 26rpx;
  1046. color: #282828;
  1047. text-align: right;
  1048. margin: 27rpx 0 0 30rpx;
  1049. padding: 0 30rpx 30rpx 0;
  1050. border-bottom: 1rpx solid #eee;
  1051. }
  1052. .my-order .list .item .totalPrice .money {
  1053. font-size: 28rpx;
  1054. font-weight: bold;
  1055. @include price_color(theme);
  1056. }
  1057. .my-order .list .item .bottom {
  1058. height: 107rpx;
  1059. padding: 0 30rpx;
  1060. }
  1061. .my-order .list .item .bottom .bnt {
  1062. width: 176rpx;
  1063. height: 60rpx;
  1064. text-align: center;
  1065. line-height: 60rpx;
  1066. color: #fff;
  1067. border-radius: 50rpx;
  1068. font-size: 27rpx;
  1069. }
  1070. .my-order .list .item .bottom .bnt.cancelBnt {
  1071. border: 1rpx solid #ddd;
  1072. color: #aaa;
  1073. }
  1074. .my-order .list .item .bottom .bnt~.bnt {
  1075. margin-left: 17rpx;
  1076. }
  1077. .my-order {
  1078. .header {
  1079. height: 250rpx;
  1080. padding: 0 30rpx;
  1081. }
  1082. }
  1083. .bg_color {
  1084. @include main_bg_color(theme);
  1085. }
  1086. .my-order .header .picTxt {
  1087. height: 190rpx;
  1088. }
  1089. .my-order .header .picTxt .text {
  1090. color: rgba(255, 255, 255, 0.8);
  1091. font-size: 26rpx;
  1092. font-family: 'Guildford Pro';
  1093. }
  1094. .my-order .header .picTxt .text .name {
  1095. font-size: 34rpx;
  1096. font-weight: bold;
  1097. color: #fff;
  1098. margin-bottom: 20rpx;
  1099. }
  1100. .my-order .header .picTxt .pictrue {
  1101. width: 120rpx;
  1102. height: 120rpx;
  1103. }
  1104. .my-order .header .picTxt .pictrue image {
  1105. width: 100%;
  1106. height: 100%;
  1107. }
  1108. .goodWrapper {
  1109. background-color: #fff;
  1110. margin-top: 20rpx;
  1111. position: relative;
  1112. padding: 0rpx 24rpx 20rpx 24rpx;
  1113. }
  1114. .goodWrapper .orderNum {
  1115. border-bottom: 1px solid #eee;
  1116. height: 86rpx;
  1117. line-height: 86rpx;
  1118. .tit {
  1119. font-size: 28rpx;
  1120. color: #282828;
  1121. }
  1122. .no {
  1123. font-size: 28rpx;
  1124. color: #282828;
  1125. }
  1126. }
  1127. .goodWrapper .item {
  1128. border-bottom: 0;
  1129. padding: 25rpx 0;
  1130. .money {
  1131. color: #999999;
  1132. font-weight: 26rpx;
  1133. margin-top: 0;
  1134. }
  1135. .attr,
  1136. .num {
  1137. font-size: 20rpx;
  1138. color: #999999;
  1139. margin-top: 0;
  1140. }
  1141. }
  1142. .goodWrapper .totalSum {
  1143. padding: 0 0 32rpx 0;
  1144. // text-align: right;
  1145. font-size: 26rpx;
  1146. color: #282828;
  1147. display: flex;
  1148. justify-content: space-between;
  1149. }
  1150. .goodWrapper .totalSum .price {
  1151. font-size: 28rpx;
  1152. font-weight: bold;
  1153. @include price_color(theme);
  1154. }
  1155. .hui {
  1156. color: #CCCCCC;
  1157. font-size: 24rpx;
  1158. }
  1159. .goodWrapper .powder {
  1160. @include price_color(theme);
  1161. //font-size: 24rpx;
  1162. }
  1163. </style>