hasLimitBuyCustom.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="app-main app-content">
  3. <block v-if="!$util.isEmpty(customList)">
  4. <block v-for="(item, index) in customList" :key="index">
  5. <tui-list-cell>
  6. <div class="tui-msg-box">
  7. <img :src="item.smallAvatar" class="tui-msg-pic" mode="widthFix" />
  8. <div class="tui-msg-item">
  9. <div class="tui-msg-name">
  10. <div class="tui-user-name">
  11. {{ item.name }}
  12. <text v-if="item.level == 2" class="super-man">大客户</text>
  13. </div>
  14. </div>
  15. <div class="tui-msg-content">
  16. <span>{{ item.visitTime.substr(5,11) }}</span>
  17. <span style="color:black;margin-left:20upx;">已购 {{ item.hasLimitBuyNum }}</span>
  18. <span style="color:black;margin-left:20upx;color:red;font-weight:bold;" v-if="item.specialPrice == true && item.reachLimitBuyNum == 1">特价量已用完</span>
  19. <span style="color:black;margin-left:20upx;color:red;font-weight:bold;" v-else-if="item.specialPrice == false && item.reachLimitBuyNum == 1">已不能购买</span>
  20. </div>
  21. </div>
  22. <button class="admin-button-com blue middle" @click="clearBuy(item)">清空已购</button>
  23. </div>
  24. </tui-list-cell>
  25. </block>
  26. </block>
  27. <block v-else>
  28. <app-wrapper-empty :is-empty="$util.isEmpty(customList)" title="暂无记录" />
  29. </block>
  30. </div>
  31. </template>
  32. <script>
  33. import TuiListCell from "@/components/plugin/list-cell";
  34. import BadgeModule from "@/components/plugin/badge";
  35. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  36. import appVipModule from "@/components/module/app-vip";
  37. import AppTag from "@/components/module/app-tag.vue";
  38. import AppSearchModule from "@/components/module/app-search";
  39. import { list } from "@/mixins";
  40. import { hasLimitBuyCustomList, clearOneLimitBuy } from "@/api/item";
  41. export default {
  42. name: "hasLimitBuyCustom",
  43. components: {
  44. TuiListCell,
  45. BadgeModule,
  46. AppWrapperEmpty,
  47. appVipModule,
  48. AppTag,
  49. AppSearchModule
  50. },
  51. mixins: [list],
  52. data() {
  53. return {
  54. customList:[]
  55. };
  56. },
  57. methods: {
  58. init() {
  59. hasLimitBuyCustomList({id:this.option.id}).then(res=>{
  60. if(res.code == 1){
  61. this.customList = res.data.customList ? res.data.customList : []
  62. }
  63. })
  64. },
  65. clearBuy(info){
  66. this.$util.confirmModal({content:'确认清空?清空后客户可重新下单'},() => {
  67. clearOneLimitBuy({customId:info.id,productId:this.option.id}).then(res=>{
  68. if(res.code == 1){
  69. this.$msg('清空成功')
  70. this.init()
  71. }
  72. })
  73. })
  74. }
  75. }
  76. };
  77. </script>
  78. <style lang="scss" scoped>
  79. .app-content {
  80. padding-top: 10upx;
  81. padding-bottom: 20upx;
  82. }
  83. .tabs-wrap {
  84. position: fixed;
  85. .tabs-left {
  86. width: 80%;
  87. }
  88. .tabs-right {
  89. width: 19%;
  90. border-left: $borderColor;
  91. @include disFlex(center, center);
  92. }
  93. }
  94. .input-wrap_box {
  95. background-color: #fff;
  96. position: fixed;
  97. top: 0;
  98. z-index: 10;
  99. width: 100%;
  100. height: 100upx;
  101. display: flex;
  102. align-items: center;
  103. padding: 0 30upx;
  104. & > view:nth-child(1) {
  105. flex: 1;
  106. }
  107. }
  108. .tui-list-cell {
  109. width: 100%;
  110. }
  111. .tui-msg-box {
  112. width: 100%;
  113. display: flex;
  114. align-items: center;
  115. justify-content: space-between;
  116. .tui-msg-pic {
  117. width: 80upx;
  118. height: 80upx;
  119. border-radius: 50%;
  120. margin-right: 20upx;
  121. }
  122. .tui-msg-item {
  123. flex: 1;
  124. min-width: 0;
  125. max-width: 500upx;
  126. min-height: 80upx;
  127. overflow: hidden;
  128. display: flex;
  129. flex-direction: column;
  130. justify-content: space-between;
  131. & > div {
  132. @include disFlex(center, flex-start);
  133. & > div:first-child {
  134. margin-right: 8upx;
  135. }
  136. }
  137. .level-img {
  138. ::v-deep.vip-text {
  139. left: 70upx;
  140. top: 8upx;
  141. }
  142. }
  143. .normal-img {
  144. width: 70upx;
  145. padding: 2upx 6upx;
  146. color: #999;
  147. background-color: #f0f2f6;
  148. border-radius: 20upx;
  149. .vip-text {
  150. font-size: 24upx;
  151. transform: scale(0.6);
  152. position: relative;
  153. top: -2upx;
  154. left: -8upx;
  155. }
  156. }
  157. .member-img {
  158. width: 70upx;
  159. padding: 2upx 6upx;
  160. color: green;
  161. background-color: #f0f2f6;
  162. border-radius: 20upx;
  163. .vip-text {
  164. font-size: 24upx;
  165. transform: scale(0.6);
  166. position: relative;
  167. top: -2upx;
  168. left: -8upx;
  169. }
  170. }
  171. .iconfont {
  172. color: #00aaed;
  173. }
  174. }
  175. .tui-msg-name {
  176. overflow: hidden;
  177. white-space: nowrap;
  178. text-overflow: ellipsis;
  179. font-size: 30upx;
  180. line-height: 1;
  181. color: #262b3a;
  182. .tui-user-name {
  183. overflow: hidden;
  184. text-overflow: ellipsis;
  185. white-space: nowrap;
  186. width: 290upx;
  187. .super-man{
  188. margin-left:20upx;
  189. color:red;
  190. font-size:24upx;
  191. display:inline-block;
  192. color:white;
  193. border:1upx solid green;
  194. padding:8upx 10upx;
  195. background-color: green;
  196. border-radius: 11upx;
  197. }
  198. }
  199. }
  200. .tui-msg-content {
  201. overflow: hidden;
  202. white-space: nowrap;
  203. text-overflow: ellipsis;
  204. font-size: 24upx;
  205. line-height: 1;
  206. color: #9397a4;
  207. .debt-amount{
  208. margin-left:20upx;
  209. .amount_num{
  210. color:red;
  211. margin-left:6upx;
  212. font-weight:bold;
  213. }
  214. }
  215. }
  216. .admin-button-com {
  217. margin-left: 20upx;
  218. white-space: nowrap;
  219. }
  220. }
  221. .tui-msg-right {
  222. max-width: 120upx;
  223. height: 80upx;
  224. margin-left: auto;
  225. margin-right: 24upx;
  226. text-align: right;
  227. display: flex;
  228. justify-content: space-between;
  229. align-items: center;
  230. }
  231. .user_tag {
  232. border: 1upx solid #cccccc;
  233. padding: 5upx 12upx 5upx 12upx;
  234. border-radius: 25upx;
  235. color: #bbbbbb;
  236. margin-right: 10upx;
  237. margin-bottom: 12upx;
  238. display: inline-block;
  239. font-size: 30upx;
  240. }
  241. </style>