123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <view>
- <view class="bg-white padding-lr-15 uni-top">
- <view class="flex justify-between top-button">
- <uni-easyinput :prefixIcon="searchShow ? 'bottom' : 'right'" suffixIcon="search"
- v-model="queryfrom.styleNum" placeholder="搜索工厂款号" @iconClick="iconClick" @confirm="getData(1)">
- </uni-easyinput>
- <view v-if="showQutation" style="width: 60px;margin-left: 10rpx;">
- <button @click="goQutation" type="primary" class="import-btn">
- <view style="font-size: 16px;">报价</view>
- </button>
- </view>
- <view style="margin-top: -4px;margin-left: 5rpx;">
- <uni-icons @click="scan" type="scan" size="43" color="#409EFF"></uni-icons>
- </view>
- </view>
- <view class="flex" v-if="searchShow">
- <view class="flex-sub padding-left-xs padding-top-xs">
- <uni-easyinput v-model="queryfrom.version" placeholder="搜索版本号"
- @confirm="getData(1)"></uni-easyinput>
- <uni-easyinput style="margin-top: 5px;" v-model="queryfrom.color" placeholder="搜索颜色"
- @confirm="getData(1)"></uni-easyinput>
- </view>
- </view>
- <view class="flex justify-between padding-top-sm" v-if="searchShow">
- <button class="mini-btn" type="default" size="mini" @click="searchShow = !searchShow">
- <text class="cuIcon-fold" style="margin-right: 5px;"></text>收回
- </button>
- <button class="mini-btn" type="primary" size="mini" @click="getData(1)">搜索</button>
- </view>
- </view>
- <view style="padding: 20px;" class="padding">
- </view>
- <uni-popup style="width: 100%;" class="" ref="popup" type="dialog" border-radius="10px 10px 10px 10px">
- <div style="width: 100%;" class="bg-white">我是分界线</div>
- </uni-popup>
- </view>
- </template>
- <script>
-
- import jweixin from 'weixin-js-sdk'
- import {
- getSign
- } from '@/api/trade/shoe-style.js'
- export default {
- name: 'pageHead',
- emits: ['click'],
- props: {
- showQutation: {
- type: Boolean,
- default: true
- },
- },
- data() {
- return {
- searchShow: false,
- getSign: getSign,
- queryfrom: {
- version: '',
- styleNum: '',
- color: ''
- }
- }
- },
- created() {
- this.getConfig()
- },
- methods: {
- goQutation() {
- uni.navigateTo({
- url: '/pages/trade/quotation/QuotationAdd'
- })
- },
- openPopup() {
- this.$refs.popup.open('center')
- },
- getConfig() {
- this.getSign({
- url: location.href,
- appid: 'wx2cfd24c7380cdc08',
- }).then(res => {
- var s = res.data
- jweixin.config({
- debug: false,
- appId: s.appId,
- timestamp: s.timestamp,
- nonceStr: s.nonceStr,
- signature: s.signature,
- jsApiList: ['scanQRCode']
- })
- })
- },
- scan() {
- const _this = this
- jweixin.scanQRCode({
- needResult: 1,
- scanType: ['qrCode', 'barCode'],
- success: function(res) {
- let str = res.resultStr
-
- let encodedURL = encodeURI(str)
-
- window.location.href = encodedURL
- }
- })
- },
- iconClick(type) {
- if (type === 'prefix') {
- this.searchShow = !this.searchShow
- } else {
- this.$emit('headGetData', this.queryfrom)
- };
-
-
-
-
- },
- getData() {
- this.$emit('headGetData', this.queryfrom)
- }
- }
- }
- </script>
- <style lang="scss">
- .uni-top {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- }
- </style>
|