nc-goods.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  1. <template>
  2. <view class="container goods-container">
  3. <view class="header-operation">
  4. <view class="header-operation-left">
  5. <view :class="{ active: type == 'goods' }" @click="switchItem('goods')">商品</view>
  6. <view :class="{ active: type == 'service' }" @click="switchItem('service')">项目</view>
  7. <view :class="{ active: type == 'money' }" @click="switchItem('money')">无码商品</view>
  8. </view>
  9. <view class="header-operation-right">
  10. <input type="text" placeholder="请输入商品编码" placeholder-style="font-size:0.14rem;color:#ACACAC;" v-model="skuNo" />
  11. <input placeholder="请输入商品/项目名称" placeholder-style="font-size:0.14rem;color:#ACACAC;" v-model="searchText" />
  12. <view class="search-btn" @click="search"><text class="iconfont icon31sousuo"></text></view>
  13. </view>
  14. </view>
  15. <view class="content">
  16. <scroll-view scroll-x="true" class="type-switch common-scrollbar" v-show="serviceCategory.length && type == 'service'">
  17. <view class="switch-item" :class="{ active: serviceCategoryId == 'all' }" @click="serviceCategoryId = 'all'">所有分类</view>
  18. <view
  19. class="switch-item"
  20. :class="{ active: serviceCategoryId == item.category_id }"
  21. v-for="(item, index) in serviceCategory"
  22. :key="index"
  23. @click="serviceCategoryId = item.category_id"
  24. >
  25. {{ item.category_name }}
  26. </view>
  27. </scroll-view>
  28. <scroll-view scroll-y="true" class="type-switch common-scrollbar" v-show="goodsCategory.length && type == 'goods'">
  29. <view class="switch-item" :class="{ active: goodsCategoryId == 'all' }" @click="goodsCategoryId = 'all'">所有分类</view>
  30. <view
  31. class="switch-item"
  32. :class="{ active: goodsCategoryId == item.category_id }"
  33. v-for="(item, index) in goodsCategory"
  34. :key="index"
  35. @click="goodsCategoryId = item.category_id"
  36. >
  37. {{ item.category_name }}
  38. </view>
  39. </scroll-view>
  40. <scroll-view scroll-y="true" class="list-wrap" v-show="type == 'service'" @scrolltolower="getService()">
  41. <view class="table-list" v-show="serviceData.list.length">
  42. <view
  43. class="table-item"
  44. :class="{ 'item-mum-2': itemNum == 2, 'item-mum-3': itemNum == 3, 'item-mum-4': itemNum == 4, active: goodsIds.indexOf(item.goods_id) != -1 }"
  45. v-for="(item, index) in serviceData.list"
  46. :key="index"
  47. @click="goodsSelect(item)"
  48. >
  49. <view class="item-name multi-hidden">{{ item.goods_name }}</view>
  50. <view class="item-info">
  51. <view class="item-img">
  52. <image
  53. :src="
  54. item.goods_image == 'public/uniapp/default_img/goods.png'
  55. ? $util.img('public/uniapp/default_img/goods.png')
  56. : $util.img(item.goods_image.split(',')[0], { size: 'small' })
  57. "
  58. @error="item.goods_image = 'public/uniapp/default_img/goods.png'"
  59. mode="widthFix"
  60. ></image>
  61. </view>
  62. <view class="item-other">
  63. <view class="item-money">
  64. <text class="util">¥</text>
  65. {{ item.price | moneyFormat }}
  66. </view>
  67. <view class="item-time" v-if="item.service_length">时长:{{ item.service_length }}分钟</view>
  68. </view>
  69. </view>
  70. <view class="no-stock" v-if="item.stock == 0"><image :src="$util.img('public/uniapp/cashier/stock_empty.png')" mode="heightFix"></image></view>
  71. </view>
  72. </view>
  73. <view class="empty" v-show="!serviceData.list.length">
  74. <image :src="$util.img('public/uniapp/cashier/goods_empty.png')" mode="widthFix"></image>
  75. <view class="tips">暂无商品</view>
  76. </view>
  77. <nc-loading :layer-background="{ background: 'rgba(255,255,255,.6)' }" :default-show="false" ref="loading"></nc-loading>
  78. </scroll-view>
  79. <scroll-view scroll-y="true" class="list-wrap" v-show="type == 'goods'" @scrolltolower="getGoods()">
  80. <view class="table-list" v-show="goodsData.list.length">
  81. <view
  82. class="table-item"
  83. :class="{ 'item-mum-2': itemNum == 2, 'item-mum-3': itemNum == 3, 'item-mum-4': itemNum == 4, active: goodsIds.indexOf(item.goods_id) != -1 }"
  84. v-for="(item, index) in goodsData.list"
  85. :key="index"
  86. @click="goodsSelect(item)"
  87. >
  88. <view class="item-name multi-hidden">{{ item.goods_name }}</view>
  89. <view class="item-info">
  90. <view class="item-img">
  91. <image
  92. :src="
  93. item.goods_image == 'public/uniapp/default_img/goods.png'
  94. ? $util.img('public/uniapp/default_img/goods.png')
  95. : $util.img(item.goods_image.split(',')[0], { size: 'small' })
  96. "
  97. @error="item.goods_image = 'public/uniapp/default_img/goods.png'"
  98. mode="widthFix"
  99. ></image>
  100. </view>
  101. <view class="item-other">
  102. <view class="item-money">
  103. <text class="util">¥</text>
  104. {{ item.price | moneyFormat }}
  105. </view>
  106. <view class="item-stock">库存:{{ item.stock }}</view>
  107. </view>
  108. </view>
  109. <view class="no-stock" v-if="item.stock == 0"><image :src="$util.img('public/uniapp/cashier/stock_empty.png')" mode="heightFix"></image></view>
  110. </view>
  111. </view>
  112. <view class="empty" v-show="!goodsData.list.length">
  113. <image :src="$util.img('public/uniapp/cashier/goods_empty.png')" mode="widthFix"></image>
  114. <view class="tips">暂无商品</view>
  115. </view>
  116. <nc-loading :layer-background="{ background: 'rgba(255,255,255,.6)' }" :default-show="false" ref="goodsLoading"></nc-loading>
  117. </scroll-view>
  118. <view class="table-pages" v-show="type == 'service' && serviceData.list.length">
  119. <uni-pagination :total="serviceData.total" :showIcon="true" @change="pageChange" :pageSize="serviceData.size" :value="serviceData.index" />
  120. </view>
  121. <view class="table-pages" v-show="type == 'goods' && goodsData.list.length">
  122. <uni-pagination :total="goodsData.total" :showIcon="true" @change="pageChange" :pageSize="goodsData.size" :value="goodsData.index" />
  123. </view>
  124. <view class="money-pages" v-show="type == 'money'">
  125. <view class="money-wrap">
  126. <view class="content-wrap">
  127. <view class="unit">¥</view>
  128. <input type="text" class="money" v-model="paymentMoney" />
  129. </view>
  130. <view class="keyboard-wrap">
  131. <view class="num-wrap">
  132. <view class="key-item" @click="keydown('1')">1</view>
  133. <view class="key-item" @click="keydown('2')">2</view>
  134. <view class="key-item" @click="keydown('3')">3</view>
  135. <view class="key-item" @click="keydown('4')">4</view>
  136. <view class="key-item" @click="keydown('5')">5</view>
  137. <view class="key-item" @click="keydown('6')">6</view>
  138. <view class="key-item" @click="keydown('7')">7</view>
  139. <view class="key-item" @click="keydown('8')">8</view>
  140. <view class="key-item" @click="keydown('9')">9</view>
  141. <view class="key-item" @click="keydown('00')">00</view>
  142. <view class="key-item" @click="keydown('0')">0</view>
  143. <view class="key-item" @click="keydown('.')">.</view>
  144. </view>
  145. <view class="operation-wrap">
  146. <view class="delete" @click="deleteCode">删除</view>
  147. <view class="delete" @click="paymentMoney = ''">清空</view>
  148. <view class="confirm" @click="paymentMoneyConfirm">确认</view>
  149. </view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. <uni-popup ref="skuPopup" type="center">
  155. <view class="sku-wrap">
  156. <view class="header">
  157. <text class="title">选择</text>
  158. <text class="iconfont iconguanbi1" @click="$refs.skuPopup.close()"></text>
  159. </view>
  160. <view class="body">
  161. <scroll-view scroll-y="true">
  162. <view class="goods-info" v-if="skuinfo">
  163. <view class="image">
  164. <image
  165. :src="$util.img(skuinfo.sku_image, { size: 'small' })"
  166. @error="skuinfo.sku_image = $util.img('public/uniapp/default_img/goods.png')"
  167. mode="widthFix"
  168. ></image>
  169. </view>
  170. <view class="info">
  171. <view class="multi-hidden">{{ skuinfo.goods_name }}</view>
  172. <view class="price">¥{{ skuinfo.price }} / {{ skuinfo.unit ? skuinfo.unit : '件' }}</view>
  173. <view>库存:{{ skuinfo.stock }}</view>
  174. </view>
  175. </view>
  176. <view v-for="(item, index) in goodsSpec" :key="index">
  177. <view class="spec">{{ item.spec_name }}</view>
  178. <view class="spec-value" v-if="!item.isWeigh">
  179. <view class="value-item" :class="{ active: spec.selected }" v-for="(spec, sindex) in item.value" :key="sindex" @click="skuSelect(spec.sku_id)">
  180. {{ spec.spec_value_name }}
  181. </view>
  182. </view>
  183. <view class="spec-value spec-value-form" v-else>
  184. <input type="number" class="spec-value-input" v-model="skuinfo.weigh" placeholder="请输入重量" />
  185. <text>{{ skuinfo.unit }}</text>
  186. </view>
  187. </view>
  188. </scroll-view>
  189. </view>
  190. <view class="footer"><button type="default" class="primary-btn" @click="skuConfirm" :disabled="skuinfo && skuinfo.stock == 0">确认</button></view>
  191. </view>
  192. </uni-popup>
  193. </view>
  194. </template>
  195. <script>
  196. export default {
  197. name: 'ncGoods',
  198. props: {
  199. goodsIds: {
  200. type: Array,
  201. default: []
  202. }
  203. },
  204. data() {
  205. return {
  206. type: 'goods',
  207. serviceCategory: [],
  208. serviceCategoryId: 'all',
  209. serviceData: {
  210. size: 12,
  211. index: 1,
  212. total: 0,
  213. list: []
  214. },
  215. goodsCategoryId: 'all',
  216. goodsCategory: [],
  217. goodsData: {
  218. size: 12,
  219. index: 1,
  220. total: 0,
  221. list: []
  222. },
  223. skuinfo: null,
  224. allsku: null,
  225. skuNo: '',
  226. searchText: '',
  227. itemNum: 3,
  228. mediaQueryOb: null,
  229. paymentMoney: ''
  230. };
  231. },
  232. created() {
  233. this.getServiceCategory();
  234. this.getGoodsCategory();
  235. this.getService();
  236. this.getGoods();
  237. },
  238. mounted() {
  239. this.mediaQueryOb = uni.createMediaQueryObserver(this);
  240. this.mediaQueryOb.observe(
  241. {
  242. maxWidth: 1300
  243. },
  244. matches => {
  245. if (matches) this.itemNum = 2;
  246. }
  247. );
  248. this.mediaQueryOb.observe(
  249. {
  250. minWidth: 1301,
  251. maxWidth: 1900
  252. },
  253. matches => {
  254. if (matches) this.itemNum = 3;
  255. }
  256. );
  257. this.mediaQueryOb.observe(
  258. {
  259. minWidth: 1901
  260. },
  261. matches => {
  262. if (matches) this.itemNum = 4;
  263. }
  264. );
  265. },
  266. methods: {
  267. getServiceCategory() {
  268. this.$api.sendRequest({
  269. url: '/cashier/storeapi/service/category',
  270. success: res => {
  271. if (res.code == 0 && res.data) {
  272. this.serviceCategory = res.data;
  273. }
  274. }
  275. });
  276. },
  277. getGoodsCategory() {
  278. this.$api.sendRequest({
  279. url: '/cashier/storeapi/goods/category',
  280. success: res => {
  281. if (res.code == 0 && res.data) {
  282. this.goodsCategory = res.data;
  283. }
  284. }
  285. });
  286. },
  287. getService() {
  288. this.$api.sendRequest({
  289. url: '/cashier/storeapi/service/page',
  290. data: {
  291. page: this.serviceData.index,
  292. page_size: this.serviceData.size,
  293. category: this.serviceCategoryId,
  294. search_text: this.searchText,
  295. sku_no: this.skuNo,
  296. status: 1
  297. },
  298. success: res => {
  299. if (this.$refs.loading) this.$refs.loading.hide();
  300. if (res.code == 0) {
  301. this.serviceData.total = res.data.count;
  302. this.serviceData.list = res.data.list || [];
  303. }
  304. }
  305. });
  306. },
  307. getGoods() {
  308. this.$api.sendRequest({
  309. url: '/cashier/storeapi/goods/page',
  310. data: {
  311. page: this.goodsData.index,
  312. page_size: this.goodsData.size,
  313. category: this.goodsCategoryId,
  314. search_text: this.searchText,
  315. sku_no: this.skuNo,
  316. goods_class: '1,6',
  317. status: 1
  318. },
  319. success: res => {
  320. if (this.$refs.goodsLoading) this.$refs.goodsLoading.hide();
  321. if (res.code == 0) {
  322. this.goodsData.total = res.data.count;
  323. this.goodsData.list = res.data.list || [];
  324. }
  325. }
  326. });
  327. },
  328. goodsSelect(data) {
  329. if (!data.stock) return;
  330. if (data.goods_spec_format || data.goods_class == 6) {
  331. this.$api.sendRequest({
  332. url: '/cashier/storeapi/goods/skulist',
  333. data: {
  334. goods_id: data.goods_id
  335. },
  336. success: res => {
  337. if (res.code == 0) {
  338. let obj = {};
  339. res.data.forEach(item => {
  340. item.goods_spec_format = JSON.parse(item.goods_spec_format);
  341. obj['sku_id_' + item.sku_id] = item;
  342. });
  343. this.allsku = obj;
  344. this.skuinfo = obj['sku_id_' + data.sku_id];
  345. this.$refs.skuPopup.open();
  346. // 兼容称重商品
  347. if (data.goods_class == 6) {
  348. let num = '';
  349. if (data.is_edit) {
  350. num = data.num;
  351. this.$set(this.skuinfo, 'is_edit', 1);
  352. }
  353. this.$set(this.skuinfo, 'weigh', num);
  354. Object.values(this.allsku).forEach((item, index) => {
  355. this.$set(item, 'weigh', num);
  356. });
  357. }
  358. }
  359. }
  360. });
  361. } else {
  362. this.$emit('select', data);
  363. }
  364. },
  365. skuSelect(sku_id) {
  366. this.skuinfo = this.allsku['sku_id_' + sku_id];
  367. },
  368. skuConfirm() {
  369. if (this.skuinfo.stock == 0) {
  370. this.$util.showToast({ title: '商品库存不足' });
  371. return;
  372. }
  373. if (this.skuinfo.goods_class == 6) {
  374. if (Number.parseFloat(this.skuinfo.weigh) <= 0 || !/^\d{0,10}(.?\d{0,3})$/.test(Number.parseFloat(this.skuinfo.weigh))) {
  375. this.$util.showToast({ title: '请输入合法的数值,数值要大于零且小数位不能超过三位' });
  376. return;
  377. }
  378. if (this.skuinfo.stock < this.skuinfo.weigh) {
  379. this.$util.showToast({ title: '商品库存不足' });
  380. return;
  381. }
  382. }
  383. this.$emit('select', this.skuinfo);
  384. this.$refs.skuPopup.close();
  385. },
  386. search() {
  387. // if (this.searchText == '') return;
  388. switch (this.type) {
  389. case 'service':
  390. this.serviceData.page = 0;
  391. this.$refs.loading.show();
  392. this.getService();
  393. break;
  394. case 'goods':
  395. this.goodsData.page = 0;
  396. this.$refs.goodsLoading.show();
  397. this.getGoods();
  398. break;
  399. }
  400. },
  401. destroyed() {
  402. this.mediaQueryOb.disconnect();
  403. },
  404. switchStoreAfter() {
  405. this.serviceCategory = [];
  406. this.serviceCategoryId = 'all';
  407. this.serviceData = {
  408. size: 12,
  409. index: 1,
  410. page: 0,
  411. total: 1,
  412. list: []
  413. };
  414. this.goodsCategoryId = 'all';
  415. this.goodsCategory = [];
  416. this.goodsData = {
  417. size: 12,
  418. index: 1,
  419. page: 0,
  420. total: 1,
  421. list: []
  422. };
  423. this.getServiceCategory();
  424. this.getGoodsCategory();
  425. this.getService();
  426. this.getGoods();
  427. },
  428. pageChange(e) {
  429. if (this.type == 'goods') {
  430. this.goodsData.index = e.current;
  431. this.getGoods();
  432. } else if (this.type == 'service') {
  433. this.serviceData.index = e.current;
  434. this.getService();
  435. }
  436. },
  437. switchItem(type) {
  438. this.type = type;
  439. if (this.type == 'goods') {
  440. this.goodsData.index = 1;
  441. this.getGoods();
  442. } else if (this.type == 'service') {
  443. this.serviceData.index = 1;
  444. this.getService();
  445. }
  446. },
  447. keydown(value) {
  448. let arr = this.paymentMoney.split('.');
  449. if (arr[1]) {
  450. if (value == '.' || arr[1].length == 2) return;
  451. if (value == '00' && arr[1].length == 1) value = '0';
  452. }
  453. if (parseFloat(this.paymentMoney + value) > 1000000) {
  454. this.$util.showToast({ title: '最大不能超过1000000' });
  455. return;
  456. }
  457. this.paymentMoney += value;
  458. },
  459. deleteCode() {
  460. this.paymentMoney = this.paymentMoney.substr(0, this.paymentMoney.length - 1);
  461. },
  462. paymentMoneyConfirm() {
  463. if (!this.paymentMoney.length) {
  464. this.$util.showToast({ title: '请输入收款金额' });
  465. return;
  466. }
  467. if (isNaN(parseFloat(this.paymentMoney)) || !/^(([0-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/.test(parseFloat(this.paymentMoney))) {
  468. this.$util.showToast({ title: '收款金额格式错误' });
  469. return;
  470. }
  471. if (this.paymentMoney <= 0) {
  472. this.$util.showToast({ title: '收款金额不能小于等于0' });
  473. return;
  474. }
  475. if (parseFloat(this.paymentMoney) > 1000000) {
  476. this.$util.showToast({ title: '最大不能超过1000000' });
  477. return;
  478. }
  479. this.$emit('select', {
  480. goods_id: parseInt(new Date().getTime() / 1000),
  481. sku_id: parseInt(new Date().getTime() / 1000),
  482. num: 1,
  483. money: parseFloat(this.paymentMoney)
  484. });
  485. this.paymentMoney = '';
  486. }
  487. },
  488. watch: {
  489. serviceCategoryId: function(nval) {
  490. this.serviceData.page = 0;
  491. this.$refs.loading.show();
  492. this.getService();
  493. },
  494. goodsCategoryId: function(nval) {
  495. this.goodsData.page = 0;
  496. this.$refs.goodsLoading.show();
  497. this.getGoods();
  498. },
  499. type: function() {
  500. this.searchText = '';
  501. }
  502. },
  503. computed: {
  504. goodsSpec() {
  505. if (this.allsku && this.skuinfo) {
  506. let data = [];
  507. if (this.skuinfo.goods_class != 6 || (this.skuinfo.goods_class == 6 && this.skuinfo.goods_spec_format)) {
  508. data = this.allsku['sku_id_' + this.skuinfo.sku_id].goods_spec_format;
  509. }
  510. if (this.skuinfo.goods_class == 6) {
  511. let obj = {
  512. spec_name: '称重',
  513. isWeigh: true
  514. };
  515. data.push(obj);
  516. }
  517. return data;
  518. }
  519. return [];
  520. }
  521. }
  522. };
  523. </script>
  524. <style lang="scss">
  525. .container {
  526. height: 100%;
  527. }
  528. .header-operation {
  529. padding: 0.2rem 0;
  530. border-bottom: 0.01rem solid #e6e6e6;
  531. display: flex;
  532. align-items: center;
  533. justify-content: space-between;
  534. .header-operation-left {
  535. display: flex;
  536. align-items: center;
  537. view {
  538. width: 1rem;
  539. height: 0.35rem;
  540. line-height: 0.35rem;
  541. text-align: center;
  542. font-size: 0.14rem;
  543. border: 0.01rem solid #e6e6e6;
  544. border-left-width: 0;
  545. transition: all 0.3s;
  546. cursor: pointer;
  547. &:hover,
  548. &.active {
  549. border-color: $primary-color;
  550. color: $primary-color;
  551. background-color: rgba($color: $primary-color, $alpha: 0.1);
  552. box-shadow: -0.01rem 0 0 0 $primary-color;
  553. }
  554. &:first-child {
  555. border-left-width: 0.01rem;
  556. box-shadow: none;
  557. }
  558. }
  559. }
  560. .header-operation-right {
  561. display: flex;
  562. align-items: center;
  563. input {
  564. background: #ffffff;
  565. border: 0.01rem solid #e6e6e6;
  566. border-radius: 0.02rem;
  567. height: 0.36rem;
  568. padding: 0 0.15rem;
  569. font-size: 0.14rem;
  570. &:first-child {
  571. margin-left: 0.1rem;
  572. margin-right: 0.1rem;
  573. }
  574. }
  575. .search-btn {
  576. width: 0.36rem;
  577. height: 0.36rem;
  578. background: #ffffff;
  579. border: 0.01rem solid #e6e6e6;
  580. border-radius: 0.02rem;
  581. border-left: 0;
  582. text-align: center;
  583. line-height: 0.36rem;
  584. cursor: pointer;
  585. }
  586. }
  587. }
  588. .content {
  589. position: relative;
  590. box-sizing: border-box;
  591. padding: 0.15rem 0;
  592. height: calc(100% - 0.78rem);
  593. transform: rotate(0);
  594. display: flex;
  595. flex-direction: row-reverse;
  596. .table-pages {
  597. display: flex;
  598. justify-content: flex-end;
  599. position: absolute;
  600. bottom: 0;
  601. left: 0;
  602. right: 1.2rem;
  603. height: 0.6rem;
  604. background-color: #fff;
  605. z-index: 1;
  606. }
  607. }
  608. .type-switch {
  609. width: 1rem;
  610. margin-left: 0.1rem;
  611. font-size: 0.14rem;
  612. margin-bottom: 0.15rem;
  613. white-space: nowrap;
  614. border-left: 0.01rem solid #e6e6e6;
  615. padding-left: 0.1rem;
  616. /deep/ .uni-scroll-view-content {
  617. display: flex;
  618. flex-direction: column;
  619. }
  620. .switch-item {
  621. padding: 0.1rem 0.2rem;
  622. color: #303133;
  623. font-size: 0.14rem;
  624. cursor: pointer;
  625. display: inline-block;
  626. }
  627. .switch-item.active {
  628. background-color: rgba(133, 88, 250, 0.1);
  629. color: $primary-color;
  630. }
  631. }
  632. .list-wrap {
  633. position: relative;
  634. flex: 1;
  635. padding-bottom: 0.4rem;
  636. }
  637. .money-pages {
  638. flex: 1;
  639. display: flex;
  640. align-items: center;
  641. justify-content: center;
  642. .money-wrap {
  643. background: #fff;
  644. border-radius: 0.05rem;
  645. .head {
  646. height: 0.6rem;
  647. line-height: 0.6rem;
  648. text-align: center;
  649. font-weight: bold;
  650. position: relative;
  651. text {
  652. font-size: 0.16rem;
  653. }
  654. .iconguanbi1 {
  655. position: absolute;
  656. right: 0.15rem;
  657. font-size: 0.22rem;
  658. cursor: pointer;
  659. }
  660. }
  661. .content-wrap {
  662. display: flex;
  663. border: 0.01rem solid #e6e6e6;
  664. height: 0.6rem;
  665. align-items: center;
  666. margin: 0 0.2rem;
  667. padding: 0 0.15rem;
  668. .unit {
  669. font-size: 0.25rem;
  670. }
  671. .money {
  672. margin-left: 0.05rem;
  673. font-size: 0.2rem;
  674. }
  675. }
  676. .keyboard-wrap {
  677. width: 4rem;
  678. padding: 0 0.2rem 0.3rem 0.2rem;
  679. margin-top: 0.1rem;
  680. }
  681. }
  682. }
  683. .table-list {
  684. display: flex;
  685. align-items: center;
  686. flex-wrap: wrap;
  687. .table-item {
  688. border: 0.01rem solid #e6e6e6;
  689. display: flex;
  690. flex-direction: column;
  691. width: 1.9rem;
  692. height: 1.15rem;
  693. padding: 0.1rem;
  694. box-sizing: border-box;
  695. margin-right: 0.1rem;
  696. margin-bottom: 0.1rem;
  697. cursor: pointer;
  698. transition: all 0.3s;
  699. position: relative;
  700. &:hover {
  701. background-color: #eee;
  702. }
  703. .item-other {
  704. display: flex;
  705. flex-direction: column;
  706. justify-content: space-around;
  707. margin-left: 0.1rem;
  708. }
  709. .item-img {
  710. width: 0.5rem;
  711. height: 0.5rem;
  712. display: flex;
  713. align-items: center;
  714. overflow: hidden;
  715. image {
  716. width: 100%;
  717. }
  718. }
  719. .item-name {
  720. height: 0.38rem;
  721. margin-bottom: 0.05rem;
  722. word-break: break-all;
  723. text-overflow: ellipsis;
  724. overflow: hidden;
  725. display: -webkit-box;
  726. -webkit-line-clamp: 2;
  727. -webkit-box-orient: vertical;
  728. }
  729. .item-info {
  730. cursor: pointer;
  731. flex: 1;
  732. display: flex;
  733. .item-time {
  734. font-size: 0.12rem;
  735. color: #909399;
  736. }
  737. .item-money {
  738. font-size: 0.14rem;
  739. color: #fe2278;
  740. line-height: 1;
  741. .util {
  742. font-size: 0.12rem;
  743. }
  744. }
  745. }
  746. .no-stock {
  747. position: absolute;
  748. z-index: 1;
  749. width: 100%;
  750. height: 100%;
  751. top: 0;
  752. left: 0;
  753. display: flex;
  754. align-items: center;
  755. justify-content: center;
  756. background: rgba(0, 0, 0, 0.5);
  757. cursor: not-allowed;
  758. image {
  759. height: 60%;
  760. }
  761. }
  762. &.active {
  763. border-color: $primary-color;
  764. background-color: $primary-color;
  765. color: #fff;
  766. .item-time,
  767. .item-money {
  768. color: #fff;
  769. }
  770. }
  771. }
  772. }
  773. .sku-wrap {
  774. display: flex;
  775. flex-direction: column;
  776. width: 7rem;
  777. height: 3.94rem;
  778. background-color: #fff;
  779. border-radius: 0.04rem;
  780. box-shadow: 0 0.01rem 0.12rem 0 rgba(0, 0, 0, 0.1);
  781. .header,
  782. .footer {
  783. height: 0.5rem;
  784. display: flex;
  785. align-items: center;
  786. justify-content: center;
  787. border-bottom: 0.01rem solid #e6e6e6;
  788. position: relative;
  789. .title {
  790. font-size: 0.16rem;
  791. font-weight: bold;
  792. }
  793. .iconfont {
  794. line-height: 1;
  795. position: absolute;
  796. right: 0.15rem;
  797. font-size: 0.2rem;
  798. cursor: pointer;
  799. }
  800. }
  801. .body {
  802. flex: 1;
  803. padding: 0.15rem;
  804. scroll-view {
  805. height: 2.55rem;
  806. }
  807. }
  808. .spec {
  809. line-height: 0.35rem;
  810. font-weight: bold;
  811. margin-top: 0.1rem;
  812. }
  813. .spec-value {
  814. .value-item {
  815. display: inline-block;
  816. height: 0.3rem;
  817. line-height: 0.3rem;
  818. background-color: #fff;
  819. color: #333;
  820. border: 0.01rem solid #e6e6e6;
  821. margin: 0.05rem 0.1rem 0 0;
  822. padding: 0 0.1rem;
  823. cursor: pointer;
  824. transition: all 0.3s;
  825. border-radius: 0.04rem;
  826. &:hover,
  827. &.active {
  828. background: rgba($color: $primary-color, $alpha: 0.1);
  829. border-color: $primary-color;
  830. color: $primary-color;
  831. }
  832. }
  833. }
  834. .spec-value-form {
  835. display: flex;
  836. align-items: center;
  837. .spec-value-input {
  838. margin-right: 0.05rem;
  839. border-width: 0.01rem;
  840. border-style: solid;
  841. background-color: #fff;
  842. color: rgba(0, 0, 0, 0.85);
  843. border-radius: 0.02rem;
  844. padding-left: 0.1rem;
  845. height: 0.38rem;
  846. line-height: 0.38rem;
  847. font-size: 0.14rem;
  848. border-color: #e6e6e6;
  849. border-radius: 0.02rem;
  850. width: 3rem;
  851. }
  852. }
  853. .goods-info {
  854. display: flex;
  855. .image {
  856. width: 0.7rem;
  857. height: 0.7rem;
  858. margin-right: 0.1rem;
  859. flex-shrink: 0;
  860. overflow: hidden;
  861. image {
  862. width: 100%;
  863. }
  864. }
  865. .info {
  866. display: flex;
  867. flex-direction: column;
  868. justify-content: space-between;
  869. .price {
  870. line-height: 1;
  871. margin-top: 0.05rem;
  872. }
  873. }
  874. }
  875. .footer {
  876. border: 0;
  877. height: 0.6rem;
  878. button {
  879. width: 95%;
  880. }
  881. }
  882. }
  883. .empty {
  884. text-align: center;
  885. padding-top: 1.2rem;
  886. image {
  887. width: 2rem;
  888. }
  889. .tips {
  890. color: #999;
  891. margin-top: 0.15rem;
  892. }
  893. }
  894. </style>